We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
knight2601
10 years agoExplorer | Level 3
Switching users in app
Hi All is it possible (in a test app) to login as user 1, view files etc, then log out and log in as user 2, view their files etc? My app is using an OAuth2 flow in .net, its a windows forms ...
knight2601
10 years agoExplorer | Level 3
Hi, I've tried that, it just auths them in to that same account but asks for permission to connect to their dropbox.
i've tried deleting local cookies, creating new browser controls (incase it was an IE caching issue) to no avail.
It's being cached in the app/api somewhere, if i close the app and reload it, its clean and prompts for login with no token, does the API cache the last key and return it instead of a new auth run?
Andy
Greg-DB
Dropbox Community Moderator
10 years agoYou didn't mention where/when you actually switched accounts. Did you do so? When using forceReapprove=true, you would need to manually (as the user on the Web site) switch the account you're logged in to by logging out and then logging in as the other account, before authorizing the app again.
- knight260110 years agoExplorer | Level 3
Hi
The app is a Windows desktop app (wpf), process:
- Load test app
- Select user - if credentials (token) doesnt exist for that user already (in app storage) - then the app directs user to a browser control to auth with dropbox.
- at this time the user can retrieve lists, download, upload etc..
- switch accounts in the app, (if credentials (token) exists in the app for that user, then dropbox will list/operate on the correct user account).
(the first time it auths in dropbox - it's fine) 2nd login auth attempt: If the credentials don't exist then user is directed to auth in dropbox, but dropbox immediately returns the authorize token from the previous user, if force is on in the connection - then dropbox shows the previous user info and asks for connection to their dropbox account.
the logout method i have - just clears the accesstoken, in the app, for the logged in user. I've tried calling the relevant endpoint to invalidate the token, but thats the wrong usage of that procedure as a new access token isnt required, just the most recent user logged in.
so it looks like either:
- the app is caching the response? I've tried removing the application cookies (using Windows.Application.SetCookie method, I've destroyed the browser and using XAMLwriter - created a new browser control in the form, deleted all relevant cookies from the cookie folder in windows (contains 'www.dropbox.com' & '__Host-js_csrf').
- dropbox api endpoint is caching the response?
So just to be clear: Its the second login to dropbox browser auth routine that is returning the 1st token, not the second.
Maybe i need to do something to notify dropbox of the user logging out?
Any ideas?
Andy
- Greg-DB10 years ago
Dropbox Community Moderator
Can you share a sample project showing the issue? That should help us see exactly where the problem is happening. Thanks in advance!- nairababayan9 years agoExplorer | Level 3I have the same problem described above.
Is there any solution for this issue?
Thanks,
Naira Babayan
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!