-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
identity/oidc: Adds proof key for code exchange (PKCE) support #13917
Conversation
Should there be a param on the OIDC provider config endpoint to enforce PKCE? Asking since there's an expected error in the spec if clients don't provide a code_challenge to a provider that requires it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally got around to this. LGTM!
Overview
This PR adds proof key for code exchange (PKCE) support to OIDC providers. Details on PKCE are available in rfc7636.
The following table shows the behavior given various PKCE-related inputs. "Present" means that the parameter was provided to the API. "Absent" means the parameter was not provided to the API or is empty. Some of this behavior isn't defined by the RFC, so I'm flexible in changing it based on feedback.
This also adds the concept of public and confidential clients. Confidential clients are the default type and may use PKCE. Public clients do not have a client secret and are required to use PKCE.
Authorization Endpoint
Token Endpoint
Testing
I've added tests that exercise PKCE using the hashicorp/cap OIDC client. I've also added some tests to verify that errors are returned when expected.
Documentation will follow in a separate PR.