I am currently working an an app that requires access to multiple Box accounts. I am using the Web API Library. So far, I am successful in accessing a single account. I am saving the auth token when I authenticate a new user. And then when I want to access any account, I use [Box +initializeSessionWithAuthToken:callbacks:] with the respective auth token. But I am only redirected back to the login page again. Just before initializing a new session, I use [Box +logoutWithCallbacks:] to logout the old user. What Am I doing wrong?
1
votes
Did you make any progress with this, I was thinking of doing the exact same thing although yet to try.
- amcc
The workaround was to write a Box REST wrapper from scratch. The official SDK doesn't seem to support Multiple Logins.
- dhilipsiva
I suspected this to be the way forward, thanks.
- amcc
1 Answers
0
votes
I know this is an old question but
+logoutWithCallbacks:nil
Should invalidate the session and log out the user. Have you verified that this method completed successfully and actually did log out the user.
Then you can use
+ (void)initiateWebViewLoginWithCallbacks:(BoxOperationCallbacksDefine)callbacks;
or
+ (void)initiateLoginUsingURLRedirectWithCallbacks:(BoxOperationCallbacksDefine)callbacks;
these will display a new web log in and allow you to create a new authentification token for the new user