cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Should we modify the Sharing experience to reduce the steps it takes to share files and folders? Tell us your thoughts right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
1
Ask
2
Comments

RespondPageWithJSRedirect() - where is this defined?

Re: RespondPageWithJSRedirect() - where is this defined?

donaldp
Collaborator | Level 9

Thanks for further explanation on the process - not having done OAuth2 before I wasn't sure what to expect where or when. With more time spent on the host issue, this led to PROGRESS! 🙂 The suggestion on the website for a redirectUri is "https://localhost", and what I've found - in the end (cos at first I changed the code to match the website, not the other way around!) - was that the program ONLY works if you include the port  and "authorize" (so "https://localhost" won't actually work, even if you had https://localhost in the code). I suggest you change the hint text on the website to include a port number and "authorize" (even if someone goes and changes them themselves. Situation not helped by freqent mentions of "you can put whatever you want there" - no you can't. If you don't include a port number it doesn't work. Ditto for the "authorize" if it's in your code. The only optional bits are http or https:, localhost or 127.0.0.1 - they all work either way. At least I've solved that now!).

So, went through the authorisation, and now the SimpleTest app is getting stuck a bit further on, at var context = await http.GetContextAsync();. Not crashing, just hung, therefore no error messages at all. Not sure what I need to do to get this line working? (I've let it sit there for several minutes now and still no sign of a response)

Note, the app was opening up a tab on my already-open browser. Just in case this was an issue, I closed my browser and reran the program (so it had a new browser all to itself), but it still hung. I can see the token there in the URL (yay! 😉 ), but it's not making it's way past that. 😞

Also, you're right. I was runing SimpleTest,but when I clicked on it to check the host I had accidentally clicked on the one underneath! Oops.

Re: RespondPageWithJSRedirect() - where is this defined?

Greg-DB
Dropboxer

I see, thanks for the feedback!

For the current issue, since you modified the code, please revert to the original SimpleTest code (or switch to a fresh copy). You should only have to add your app key; no other code changes are necessary for that sample.

It sounds like the app is hanging waiting on the user to come back to the previously configured redirect URI, but you may have accidentally changed what that path is, meaning it will never match

Re: RespondPageWithJSRedirect() - where is this defined?

donaldp
Collaborator | Level 9

Woo hoo! Success! 🙂

> you may have accidentally changed what that path is, meaning it will never match

It was actually getting stuck at the line before the one you have highlighted, but in any case loading in a fresh copy, and knowing what to put into the website now, got it all working. 🙂

Now that we've got that little proof of concept done on my computer, I can get back to MY program and try and work out why IT'S not working (but now I can compare directly to SimpleTest, sicne I know that works). Will let you know how I go.

BTW, I still recommend you fix up that hint text (and be more specific with people when they ask what needs to go there). It DOES NOT work unless you include a port (and in the case of SimpleTest, you must also include the authorize). A proper example in the hint (i.e. showing that you need to the port number too) would be helpful.

Thanks! 🙂

Who's talking

Top contributors to this post

  • User avatar
    donaldp Collaborator | Level 9
  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?