Forum Discussion

Scott_M's avatar
Scott_M
Explorer | Level 3
9 years ago
Solved

OAuth2 http authentication, how to have browser show success?

In our OAuth1, after the user clicked 'Allow' in the browser, the user would get a 'success' message.

 

In our OAuth2, the 'Allow' page in the browser just sits there (even though the app has authenticated and gotten the token). Eventually it times out and says:

 

"Hmm, we can't reach this page."

 

It seems to me that somehow that browser should get updated to say 'success'.

 

I've implemented a localhost server on the specified port and it is getting the returned authorization code. Do I need to post something back to let the browser know everything is fat, dumb and happy? If so, what?

  • Thanks! That's helpful, and it's what I expected. In this case, the best solution would be to configure your localhost server to respond to that GET request with a simple HTML success page of your liking.

4 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

    The OAuth 1 and OAuth 2 flows do work a bit differently. With the OAuth 2 "code" flow, which it sounds like you're using, the user is sent to the specified redirect URI after they authorize your app. That's how the app receives the authorization code. Often, this is just an Internet-hosted web page, so the user sees whatever web page that is.

    In your case though, it sounds like you're using a localhost server just to receive the redirect, and there's no page to display. If that's the issue, you can have your localhost server itself respond with a simple success page to display at that point.

    Feel free to post a screenshot of the issue to make sure I understand what you're seeing though.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago
    Thanks! That's helpful, and it's what I expected. In this case, the best solution would be to configure your localhost server to respond to that GET request with a simple HTML success page of your liking.
  • Scott_M's avatar
    Scott_M
    Explorer | Level 3
    9 years ago

    OK. It might be nice if there was a way to get the browser to display a success response (as in OAuth1) where the success message had a Dropbox look and feel to it.

     

    But I have it doing something semi-ugly now. I'll see if I get someone to put together something nice looking...

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!