-
-
Notifications
You must be signed in to change notification settings - Fork 926
Add PKCE support (for v5-dev Typescript) #659
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
Open
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This partially addresses issue #637 by implementing PKCE.
ghost
commented
Feb 25, 2021
Is this ever going to get merged? It would be amazing to have this functionality.
miccoh1994
commented
May 12, 2021
You guys may want to check out this repo https://github.com/jasonraimondi/typescript-oauth2-server
This was referenced Nov 28, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull implements PKCE support (RFC7636). It is originally based on pull #452, but has been cleaned up a bit. Changes should be almost identical to pull #658, but cleaned up for Typescript.
Summary of changes:
code_challenge,code_challenge_method, andcode_verifier) are not passed to the server, the server behaves exactly the same as before. PKCE mode is enabled only when:code_challenge(and optionallycode_challenge_method) parameters are included during authorization code grant.code_verifierparameter is included during token grant. Whencode_verifierparameter is included,client_secretis ignored since we are using PKCE for authentication.codeChallengeandcodeChallengeMethod) to the authorization code model. Changes are required toModel#saveAuthorizationCodeandModel#getAuthorizationCodeto persist and retrieve these 2 new fields if they are present.Model#saveAuthorizationCodeandModel#getAuthorizationCodemethods, they will continue to work just as they did before the change.Example of my changes to
saveAuthorizationCodefor a MongoDB model (in Typescript):Example of my changes to
getAuthorizationCodefor a MongoDB model (in Typescript)