We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
CloudServices
4 years agoNew member | Level 2
Using IdentityModel.OidcClient with Dropbox
Hey
I'm using the IdentityModel.OidcClient to authenticate the dropbox account of a user within my application.
The authentication works as expected with one exception: The redirect_uri. ...
Здравко
4 years agoLegendary | Level 20
CloudServices wrote:...
"Invalid redirect_uri: "https://127.0.0.1:51931": It must exactly match one of the redirect URIs you've pre-configured for your app (including the path)."
... Is there a limitation to the amount of redirect URIs?
...
Hi CloudServices,
If you take a look on the parts of your post, that I enlightened above, you will find out the response, I believe.
For Dropbox, URI can vary (arbitrary or not) within border of set of pre-configured redirect URIs, associated to your application. If particular URI (including loopback variation) is not there, error comes up. That's it. Take a look on your application settings.
To be honest, I don't understand what kind of connection problems you are trying to avoid and how port randomization would help you!? 🤔
Hope this clarifies matter.
CloudServices
4 years agoNew member | Level 2
Example:
My registered redirect URI at google is https://127.0.0.1. If I now send an authentication request with the redirect URI set to https://127.0.0.1:51931. Google accepts this redirect URI, because the port doesn't change the destination.
Dropbox on the other hand seems to be very strict when it comes to the redirect URIs. The redirect URI from the authentication request has to match exactly the registered redirect URI (port included).
I would prefer to use random ports to avoid problems on machines where ports might be not available do to e.g. firewall settings. This way it's possible to switch from a blocked port to a free port without having to register another redirect URI.
- Greg-DB4 years ago
Dropbox Community Moderator
Thanks for writing this up! I'm sending this along to the team to see if we can get this supported. I can't promise if or when that might be done though.
- Здравко4 years agoLegendary | Level 20
CloudServices wrote:...
I would prefer to use random ports to avoid problems on machines where ports might be not available do to e.g. firewall settings. This way it's possible to switch from a blocked port to a free port without having to register another redirect URI.Aha... About the firewall: If your access is forbidden such a move is not gonna fix it. It's unlikely loopback port becomes issue, but if happens to be you should fix your firewall settings, instead.
Yes, it's likely some other service to engage some particular port and so block your application. More stable workaround is registration of few ports and try them sequentially. Very, very unlikely to be needed more than 3 tries. Even if your application falls in such a situation, it's most likely system issue, rather than your application issue. Restarting the system usually fixes the issue. Dropbox site uses the same approach. Linking the site to installed local application happens through port 17600. If it's engaged already, the following (17601) is on go to be tried. If needed, 17602 is going to try. If no one of all 3 ports provides proper response, the site assumes no working local application available. 😉 Just for example. Your situation is different but the same way may be used.
Hope this helps.
- dgeiss4 years agoExplorer | Level 3This is a solution, but not the desired one.
Let's say the application, that wants to make the authentication, runs on a device, that I can't administrate, because the device belongs to a customer. In this case it would be great to have the opportunity to switch to any port without having the need to register all possible redirect uri, port combinations.- Здравко4 years agoLegendary | Level 20
dgeiss wrote:
...
Let's say the application, that wants to make the authentication, runs on a device, that I can't administrate, because the device belongs to a customer. ...Hm... 🤔 Do you assume that Dropbox application can be installed only on devices Dropbox is able to administrate? 🧐🙂 I don't think so... 🤷 Dropbox is not an administrator on my laptop, where I'm writing now for example, but the application still work (including mentioned loopback port). 😉 You definitely don't need to be administrator on device where your application works on.
About 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!