cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done here!

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Hide asking confirmation on login

Hide asking confirmation on login

Issac J.
New member | Level 1

Hello, is it possible to remove the authorization popup everytime on logging in?

If once user is logged in i don't need to show the popup in next login. Is it possible?

7 Replies 7

Re: Hide asking confirmation on login

Greg-DB
Dropboxer

Yes, your app can store and re-use the resulting access token for each user, so that it doesn't need to send the user through the OAuth app authorization flow each time. 

Exactly how you do so depends on your platform, and the library/SDK you're using, so I recommend referring to the relevant tutorial and/or documentation.

Re: Hide asking confirmation on login

Issac J.
New member | Level 1

Hello Gregory, the platform I am using is JavaScript. The ide i am using is wakanda(open source for both server side and client side js). The method i am using for authorization is by calling 

https://www.dropbox.com/1/oauth2/authorize/?response_type=token&&client_id='client_Id'&&redirect_uri...".

Could you please suggest a method for hiding the confirmation box on each log in ?

Re: Hide asking confirmation on login

Greg-DB
Dropboxer

The result of the OAuth 2 authorize URL you posted is an access token. When that access token (which is just a string) is returned to your app, you can store and re-use it in the future, so that you don't have to send the user to that authorize URL again. Since the access token is just a string, you can store is in whatever data persistence layer you have (i.e., your database, or the browser's local storage, etc.).

Re: Hide asking confirmation on login

Issac J.
New member | Level 1

Ok. I will try that.

Re: Hide asking confirmation on login

Issac J.
New member | Level 1

But the access token generated will be different for different users right? I am not having a specific  login to the application for getting userid. The only authorize call is to the dropbox. If multiple users are using this application and if one particular accesstoken is stored and fetched from the storge, all the items be stored into that particular account.

Re: Hide asking confirmation on login

Greg-DB
Dropboxer

That's correct, access tokens are user-specific. It sounds like you mean that your app doesn't have its own user model, and is relying on the Dropbox app authorization flow as authentication. First, it's worth noting that OAuth 2 is for authorization, not authentication, e.g., see these blog posts. Anyway, if you do use this for that anyway, to avoid unnecessarily putting the user through this flow, you can store the necessary data, e.g., the access token, in their cookies or local storage. If and only if you don't find that, you can send them the flow. Also, check out the documentation for the force_reapprove parameter on /oauth2/authorize. By default, Dropbox will automatically redirect the user through the flow when possible.

Re: Hide asking confirmation on login

Issac J.
New member | Level 1

Thanks Gregory for your support.

Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    Issac J. New member | Level 1
  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?