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
donaldp
3 years agoCollaborator | Level 9
Getting invalid request for PKCEOAuthFlow.ProcessCodeFlowAsync
Hi, I'm implementing PKCE now, but getting an invalid request exception. I can't see anything that I'm doing wrong from the doco (it says everything is optional except code and appkey). This i...
Здравко
Legendary | Level 20
donaldp wrote:...
if (code is object) {
PKCEOAuthFlow pKCEFlow=new PKCEOAuthFlow();...
As can be seen from your post, you are constructing pKCEFlow object anew after you have got the code. How you guarantee that PKCE code challenge, send as part of initial query (targeting the code you have received on redirect), match to the code verifier used on followup code processing (both generated and carried within PKCEOAuthFlow object)? 🤔 This workflow targets extremely difficult prediction of such pair, so security gonna be improved. If it was so easy to predict second pair' element (just construct a new object), 😁 what's the meaning of PKCE usage at all?
Hope this gives direction. 😉
donaldp
3 years agoCollaborator | Level 9
Hi,
> As can be seen from your post, you are constructing pKCEFlow object anew after you have got the code
Yes, that's right. I'm getting the code directly from the browser - I'm not doing it via the app - so this is the first step in the process in the app. There is no redirect. The user gets the code, then comes to the app with it. The doco says that you can do that, hence why the subsequent parameters are all optional. It's not working though (as is).
- Здравко3 years agoLegendary | Level 20
donaldp wrote:... I'm getting the code directly from the browser - I'm not doing it via the app - so this is the first step in the process in the app. There is no redirect. The user gets the code, then comes to the app with it. The doco says that you can do that, hence why the subsequent parameters are all optional. It's not working though (as is).
Ok, that's right. Nothing against what you say, it's correct. Do you intentionally bypass my actual notes posted before? 🤷 If you don't want, don't read them.
Edit:
donaldp wrote:... I'm getting the code directly from the browser - I'm not doing it via the app - so this is the first step in the process in the app. ...
The first step is constructing and launching Dropbox authentication (URL construction that must include code challenge). What you are talking about is going to be the second one! Both are strictly related to each other - something you are missing, seems!
- donaldp3 years agoCollaborator | Level 9
>The first step is constructing and launching Dropbox authentication
And the doco states that step is optional, as I already said. I therefore don't know what code is needed to get this working when one isn't constructing and launching a redirect. If you're getting the code directly from a browser as the actual first step, then the next step is entering that code into the app, unless someone can tell me a different first step for bypassing using a redirect (I already asked if there's a different URL needed to be used for the PKCE flow - I'm using the same URL as non-PKCE flow, but maybe that's the issue?).
- Здравко3 years agoLegendary | Level 20
donaldp wrote:...
And the doco states that step is optional, as I already said. ...
Probably we are talking for different things. How constructing URL used on launching the browser (where you are getting code) can be optional? You are getting such code every time OAuth is on go, but it's optional... 🤔 Can you clarify the meaning of word "optional" here (in this context)?
This is something mandatory for any type of Flow in use and both with and without redirection! Sometimes it's simple, sometimes little bit complicated. When SDK is in use you are relying on the SDK code to do this, should look the same. Just careful what code is used to construct it. Don't mix different code (from different flows) together.
One more thing:
donaldp wrote:... (I already asked if there's a different URL needed to be used for the PKCE flow - I'm using the same URL as non-PKCE flow, but maybe that's the issue?).
What actually means "the same URL"? If you mean URL received using the same code (PKCEOAuthFlow class code), that's correct. Since this URL will contain within code challenge (something supposed to be unique for every query), URL literal gonna be different. If you mean usage of a constant URL literal..., where and how will come code challenge from - something mandatory for PKCE?
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,915 PostsLatest Activity: 2 days 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!