The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to login to vbulletin from .net application
Below is the code i am currently using. It appears to work for a couple of seconds. After i run it, the user is redirected to vbulletin welcome page with the username showing then goes back to log in page logging out the user.
Password = MD5(Password); string data = "vb_login_username=" + Username + "&vb_login_password=&s=&do=login&vb_login_md5passw ord=" + Password + "&vb_login_md5password_utf=" + Password; HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://forum.[domain].com/login.php?do=login"); request.Method = WebRequestMethods.Http.Post; request.ContentType = "application/x-www-form-urlencoded"; request.UserAgent = "-- vBulletin Vaidation --"; request.ContentLength = data.Length; StreamWriter rStream = new StreamWriter(request.GetRequestStream()); rStream.Write(data); rStream.Flush(); rStream.Close(); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); StreamReader resReader = new StreamReader(response.GetResponseStream()); string str = resReader.ReadToEnd(); response.Close(); if (str.Contains("Thank you for logging in")) { return str; //str is the html of the welcome page } else { return "invalid login"; } another approach i have used is the api. But I wasnt able to make it work. on the official vbulletin api documentation they are saying the below: "So after this API call (login_login), client should call api_init (get new session as well as new common $show variables) or api_getsecuritytoken to get the new securitytoken. Once the client gains both the new sessionhash and the securitytoken, please save them in application session vars. After this the login process is done. You need to pass the new sessionhash to the API and use the new securitytoken to sign the requests in future API method calls." I was able to call the login_login successfully with positive response. the rest is not clear. can some1 help |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|