cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We are making some updates so the Community might be down for a few hours on Monday the 11th of November. Apologies for the inconvenience and thank you for your patience. You can find out more 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: 

javascript single page oauth

javascript single page oauth

tonetheman
New member | Level 2
Go to solution

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 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

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.

View solution in original post

1 Reply 1

Greg-DB
Dropbox Staff
Go to solution

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.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?