We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here. 

Forum Discussion

RTS S.'s avatar
RTS S.
Helpful | Level 6
6 years ago

IOS ASWebAuthenticationSession for OAuth

Previously I used a WKWebView  browser control to perform the OAUth. This allowed me to trap the redirect URL to obtain the access code. My redirect URL was http://localhost/Auth

Now I am using the Native browser interface ASWebAuthenticationSession This requires that you use an APPLICATION specific callback URL scheme for your redirect uri. i.e. MyAppName://Auth

The Dropbox APP console allows me to specifiy this as the Redirect URL but gives an error when I try to call the  oauth2/authrize endpoint using this as the redirect_uri

  • Thanks, I used the Code flow as it looked more secure.

    It would seem that custom URL schemes would be as secure as LOCALHOST ... both of which can only work on the user's device.

     

     

     

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    Can you share the full URL of the page displaying the error, as well as the text of the error itself? Thanks in advance! 

    • RTS S.'s avatar
      RTS S.
      Helpful | Level 6
          static let CLIENT_ID = "......"
          static let CLIENT_SECRET = "...."
          static let REDIRECT_URL = "myapp://Auth"
          static let OAUTH_URL = "https://www.dropbox.com/1/oauth2/authorize"
          
          override func OAuthURL() -> String {
            return String(format:"%@?redirect_uri=%@&response_type=code&client_id=%@&force_reapprove=true",
                          DropboxOAuthInfo.OAUTH_URL,
                          HTTP.urlEncode(DropboxOAuthInfo.REDIRECT_URL),
                          DropboxOAuthInfo.CLIENT_ID)
          }
      
      

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,875 PostsLatest Activity: 2 months ago
325 Following

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 or Facebook.

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!