Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module missing verification during code exchange #2

Open
bzuillsmith opened this issue Feb 28, 2019 · 3 comments
Open

Module missing verification during code exchange #2

bzuillsmith opened this issue Feb 28, 2019 · 3 comments

Comments

@bzuillsmith
Copy link

I'm trying to add pkce to the code flow so that a public native client can more securely exchange the code for an access token.

It appears this extension parses the two parameters for pkce upon the initial authorization redirect from the client, but does not do anything else. After looking at the oauth2orize code, it seems like we also need to extend the exchange function to include the code_challenge verification in the exchange process. Is this correct?

Should this module actually include two things: the grant extension and an exchange extension?

I may be missing something but this is what I've gathered so far after reading the oauth2orize and this pkce code.

If I'm on the right track, I might have time to work on a PR if this or at least fill in the docs some more.

@revant
Copy link

revant commented Mar 11, 2019

After using server.grant(pkce.extensions()) I was able to find codeChallenge and codeChallengeMethod in txn.req passed to issue callback
https://github.com/jaredhanson/oauth2orize/blob/master/lib/grant/code.js#L181

Also the request body is available during code exchange (without using any extension) https://github.com/jaredhanson/oauth2orize/blob/master/lib/exchange/authorizationCode.js#L106

@elainegasca
Copy link

@revant Can you pass an example what you did to get codeChallenge and codeChallengeMethod please?
Regards.

@dvarnai
Copy link

dvarnai commented Apr 19, 2020

If anyone's wondering, you can read the code_verifier in the exchange code callback from the request body (4th argument of the callback)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants