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
Shy1
3 years agoExplorer | Level 3
It must exactly match one of the redirect URIs you've pre-configured for your app (including the pat
I'm completely confused. I do it according to the documentation, if I make a link with my hands in my browser and insert the AppiKey, then everything works, if I try to do it through the code, ...
Здравко
3 years agoLegendary | Level 20
Shy1 wrote:
...
if I try to do it through the code, I get this Invalid redirect_uri message.
It must exactly match one of the redirect URIs you've pre-configured for your app (including the path). In console I added redirect url just like in code private const string LoopbackHost = "http://127.0.0.1:4200/"; what is my problem...
Hi Shy1,
To be honest, I'm not certain what exactly you're asking for (the question contains response within). I will speculate that you cannot understand difference between terms URI and host (domain name) and that's why you mix them. Your LoopbackHost keeps the host (represented as IP 127.0.0.1 - i.e. loopback IP) as part of URL used as a base for further construction of final redirect URI (here it's URL actually). On registration, complete URL have to be used without possible parameters (anchor isn't used at all). The parameters will be added on redirection and you should process them in your code. 😉 Hope now it's a bit more clear. Take a look here for more info related to URL anatomy (URI can be considered as a URL generalization, but in your case they mean the same thing in fact). 😁 How looks like the redirect URI in your code and is it registered appropriately? 🧐🙂 If you are still not sure, what appears in your browser address bar on redirection (and before that) and after remove parameters is it the same as the registered URI? Is your browser launched with the same URL when you make it by hands and through the code? Why?
Hope this gives direction and clarifies matter.
In addition, you can read the comments in your code:
Shy1 wrote:...
... // URL to receive OAuth 2 redirect from Dropbox server. // You also need to register this redirect URL on https://www.dropbox.com/developers/apps. private readonly Uri RedirectUri = new Uri(LoopbackHost + "authorize"); ......
Does the above advice (need to register this redirect URL on) take proper attention? 🤔
- Shy13 years agoExplorer | Level 3
i am just delete anchor and error disapear. but i am still cant redirect to my 127.0.01 i suppose at my configuration pc problem? but at the browser url i have request
- Здравко3 years agoLegendary | Level 20
Shy1 wrote:i am just delete anchor and error disapear. ...
Shy1, Hmm.. 🤔 How have you deleted something nonexistent? I can see some anchor in your code responsible for redirect URI construction! I'm not sure you have some "configuration pc problem", but most probably you are mixing anchor and resource path. 🙂
Shy1 wrote:... but at the browser url i have request
Probably you mean the "redirect_uri" parameter there. Is the parameter value registered in the form it appears without your "correction"? 😉
Let me guess what's there. At the beginning you have a constant:
private const string LoopbackHost = "http://127.0.0.1:4200/";
The 'LoopbackHost's value is clear, as you noted it's "http://127.0.0.1:4200/". Let's see the next value:
// You also need to register this redirect URL on https://www.dropbox.com/developers/apps. private readonly Uri RedirectUri = new Uri(LoopbackHost + "authorize");
Now we have previous value concatenated with "authorize" (i.e. 'RedirectUri's value is "http://127.0.0.1:4200/authorize"). 😉 Is that what appear? And as noted (in the comment), had you registered it? 🧐
About how your PC handle it, take a look here:
while (context.Request.Url.AbsolutePath != RedirectUri.AbsolutePath)
You code waits for the same 'RedirectUri's value and ignore everything else (keeps looping) until appearing. Can this even happen in your case? (your PC receives this value "corrected" by your hand!!!)
- Shy23 years agoNew member | Level 2
yes, I have it registered, because I can read. I get a response from the correct link, but my bowser gets the following error and the code exits without any exceptions, it just dies out. if I go through the debugger then I get to the HandleJSRedirect and everything ends there and if not through the debugger, then it ends on the process call Process.Start(); I do not understand anything
ERR_CONNECTION_REFUSED link what i have but i cant work with her and link down
maybe it's how i run it?
static void Main(string[] args) { Program program = new Program(); var task = Task.Run(program.MainRun); task.Wait(); } public async void MainRun() { var accessToken = await this.GetAccessToken(); }
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,920 PostsLatest Activity: 3 hours ago
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!