Forum Discussion

tonetheman's avatar
tonetheman
New member | Level 2
9 years ago
Solved

javascript single page oauth

I have a working application using the python sdk that has a flask server as a backend. And that works I am good with the oauth flow and the application does what it is supposed to do.

 

I started playing with Javascript sdk looking for a way to do oauth without a backing server (aka single page app or basically all in the client).

 

Is that possible? It looks like you always need a spot to redirect to with the Javascript sdk.

 

thanks

 

1 Reply

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago

    For reference, this JavaScript SDK auth example shows how to initiate the app authorization flow:

     

    https://github.com/dropbox/dropbox-sdk-js/blob/master/examples/javascript/auth/index.html#L89

     

    The parameter passed to getAuthenticationUrl should be where the user should be sent back to after authorizing your app.

     

    In your case, where is your JavaScript single page app hosted? I.e., what's the URL in the browser when you're on the page? You may be able to use that as a redirect URI.

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!