You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
xtremebytes
7 years agoExplorer | Level 3
Dropbox invalid redirect_uri, must be an absolute uri
My app (Xamarin Forms) used to work with the Dropbox API authorisation but now it is showing me an error "invalid redirect_uri, must be an absolute uri". This started happening, probably after I upgraded the Visual Studio/Xamarin nuget package for Dropbox.Api to 4.8.0 from 4.7.0. Absolutely, nothing else in the code for Dropbox authorisation was changed.
Yet, the non-local URLs I have for OAuth2 redirection on my app begin with "https://". What could have gone wrong?
@xtremebytes
This is the Xamarin Issue which causes the problem. Apparently work in progress:
[iOS] WebView.Source URL's are HTML encoded
Hope that helps.
- xtremebytesExplorer | Level 3
Digging in a bit deeper and looking at this code fragment:
this._oauth2State = Guid.NewGuid ().ToString ("N"); var authorizeUri = DropboxOAuth2Helper.GetAuthorizeUri (OAuthResponseType.Token, DropboxAppKey, RedirectUri, this._oauth2State, false, false, null, true); //force re-authenticate var webView = new WebView { Source = new UrlWebViewSource { Url = authorizeUri.AbsoluteUri } }; webView.Navigating += async (sender, e) => { if (!e.Url.StartsWith (RedirectUri, StringComparison.OrdinalIgnoreCase)) { // we need to ignore all navigation that isn't to the redirect uri. return;
the e.Url used to match the RedirectUri, and now it doesn't. Instead, the e.Url now contains the RedirectUri as a query string parameter as follows:
Is there something more that I am missing?
- xtremebytesExplorer | Level 3
Another note: the code is based on https://gist.github.com/tomcrusader/b0856a383bcdcf905c7a774c8c1b0879 -- and it used to work fine.
- xtremebytesExplorer | Level 3
Seems like there were some issues with the new Xamarin Forms upgrade, .net and PCL stuff, so I rolled back all packages upgrades including Dropbox and now things are working.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,912 PostsLatest Activity: 5 hours agoIf 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!