We’re aware of an issue causing slower load times on the Dropbox Community forum. It should be resolved soon. Thanks for your patience! 

Forum Discussion

jenseno's avatar
jenseno
Explorer | Level 4
9 years ago
Solved

API v2 access token validity and authorization redirect URL response

Is it correctly understood that the token I get from a user after the authorization flow, is valid until the user revokes it?  Meaning I can just store it securely in the app and use it each time it's needed?

 

Second question. If I can not close the browser that presented the dropbox authentication dialog (on calling redirect_uri, is there anything I can return that will says success or possible close the browser window?

 

Thanks in advance

 

Odin

 

  • That's correct, a Dropbox API access token doesn't expire by itself, but it can be revoked at any time, by either the user or app. That being the case, your app should store and re-use the access token for a user.

    What you can do with the final state of the browser in the app authorization flow depends on exactly how you have it implemented. Can you elaborate on how your setup currently works? Specifically, are you using an embedded browser or the external system browser, which OAuth 2 flow are you using, and what, if any, redirect URI are you using?

3 Replies

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago
    That's correct, a Dropbox API access token doesn't expire by itself, but it can be revoked at any time, by either the user or app. That being the case, your app should store and re-use the access token for a user.

    What you can do with the final state of the browser in the app authorization flow depends on exactly how you have it implemented. Can you elaborate on how your setup currently works? Specifically, are you using an embedded browser or the external system browser, which OAuth 2 flow are you using, and what, if any, redirect URI are you using?
  • jenseno's avatar
    jenseno
    Explorer | Level 4
    9 years ago

    Hi. Thank for you answer. I use the system browser and redirect back to localhost inside my app.

    Now I just return a HTML page with a message saying the user was authorized and they can return to the app.

    Plus a link to close the browser window.

     

    Later i'll probably switch to an embedded browser and the webpage will close itself ;)

    Actually everything is working just fine, but I get a 400 error when trying to get a token from the code I get from the auth flow so I'm kinda stuck there.

About Dropbox API Support & Feedback

Node avatar for 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!