The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to keep a user logged in using the API?
Hello,
We've been trying to use the vBulletin API and have spent hours attempting to successfully keep a user logged in to no avail This is very frustrating because the documentation on and vBulletin support regarding the API is very limited. We have managed to successfully login users via the API and receive (for example) the following information back: Code:
[session] => Array ( [dbsessionhash] => 9e0df97bb21240fc014418ede5e6c1bd [userid] => 1 Specifically, we are referring to this (very vague) part of the vBulletin API documentation help (found here: https://www.vbulletin.com/forum/cont...s-Mobile-API): Quote:
We are completely stuck at this point and it's so frustrating because we've gotten everything else to work perfectly with the API. Please let us know and thank you so much! We really appreciate it! |
#2
|
|||
|
|||
I don't have any experience with the api, but if you look at this page: https://www.vbulletin.com/forum/cont...334-mobile-api the section titled "Request/Result Verification" seems to show some code for signing a request.
|
#3
|
|||
|
|||
Quote:
Anyone else? |
#4
|
||||
|
||||
When you call api_init, you get given an access token.
Code:
array ( 'apiversion' => 4, 'apiaccesstoken' => '31e6c1ea1ae6eca7a538057781234567', 'bbtitle' => 'Test Forum', 'bburl' => 'http://www.xxxxxxx.org/vb/40a', 'bbactive' => 1, 'forumhome' => 'index', 'vbulletinversion' => '4.1.10', You pass this in all other calls as 'api_s', this is the sessionhash for your user. Code:
api_c = 2 api_m = private_messagelist api_v = 4 api_s = 31e6c1ea1ae6eca7a538057781234567 api_sig = dab14537fd1bf42119a359ee6265fa0a folderid=-1 |
#5
|
|||
|
|||
Quote:
Thanks for your assistance, Paul. However, we are already doing what you have outlined above. That's simply how to sign and execute any method with the API. We've already gotten that to work a long time ago, that isn't the problem here. The problem is how to keep a user logged in AFTER you've run the login_login method. Specifically, this: Quote:
How do we do that? |
#6
|
||||
|
||||
Quote:
When you create a session with api_init, and get the (session) accesstoken, the userid in the session table at that point is 0. Once you login correctly using the login_login method, that session userid is changed to x (your userid), so any future requests with that access token will run as userid x. FYI, those details were taken direct from a sucessful session, where I logged in, and then checked the PM folder. |
#7
|
|||||
|
|||||
Quote:
OK, let's dissect the paragraph we pasted earlier because something doesn't make sense to us. Here is the paragraph: Quote:
Now let's dissect it one-by-one: Quote:
Quote:
Quote:
Please be as clear and specific as you can, and please provide examples where possible. This is very confusing but we are relieved to hear you actually got it to work! Thanks again for your assistance with this, we greatly appreciate it. |
#8
|
|||
|
|||
Hi,
I am facing similar problem. Did you get answer to this? Please help. Once logged in using api when i am redirecting to activity.php url with s=sessionid, still it asks me to enter username and password. I expect it to land me in logged in page. Regards |
#9
|
|||
|
|||
Was anyone able to fix this? I am facing the exact same thing
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|