-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat!: support PKCE in the oauth2 client's auth/exchange flow #21215
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
base: main
Are you sure you want to change the base?
Changes from all commits
08f52e9
40283ea
5eb6e9f
53fc864
ead92c8
0be0bb2
303ea30
7af6c3a
7f11ab7
65b08c8
c6b3b24
37aa4c0
263b925
3e78053
ef3a3d3
82fdc0f
a753ff4
675b528
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -940,7 +940,7 @@ func New(options *Options) *API { | |
| r.Route(fmt.Sprintf("/%s/callback", externalAuthConfig.ID), func(r chi.Router) { | ||
| r.Use( | ||
| apiKeyMiddlewareRedirect, | ||
| httpmw.ExtractOAuth2(externalAuthConfig, options.HTTPClient, options.DeploymentValues.HTTPCookies, nil), | ||
| httpmw.ExtractOAuth2(externalAuthConfig, options.HTTPClient, options.DeploymentValues.HTTPCookies, nil, externalAuthConfig.CodeChallengeMethodsSupported), | ||
| ) | ||
| r.Get("/", api.externalAuthCallback(externalAuthConfig)) | ||
| }) | ||
|
|
@@ -1289,14 +1289,15 @@ func New(options *Options) *API { | |
| r.Get("/github/device", api.userOAuth2GithubDevice) | ||
| r.Route("/github", func(r chi.Router) { | ||
| r.Use( | ||
| httpmw.ExtractOAuth2(options.GithubOAuth2Config, options.HTTPClient, options.DeploymentValues.HTTPCookies, nil), | ||
| // Github supports PKCE S256 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to call this out, link to docs?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's nested in these docs: https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps It is not easy to point out imo. |
||
| httpmw.ExtractOAuth2(options.GithubOAuth2Config, options.HTTPClient, options.DeploymentValues.HTTPCookies, nil, options.GithubOAuth2Config.PKCESupported()), | ||
| ) | ||
| r.Get("/callback", api.userOAuth2Github) | ||
| }) | ||
| }) | ||
| r.Route("/oidc/callback", func(r chi.Router) { | ||
| r.Use( | ||
| httpmw.ExtractOAuth2(options.OIDCConfig, options.HTTPClient, options.DeploymentValues.HTTPCookies, oidcAuthURLParams), | ||
| httpmw.ExtractOAuth2(options.OIDCConfig, options.HTTPClient, options.DeploymentValues.HTTPCookies, oidcAuthURLParams, options.OIDCConfig.PKCESupported()), | ||
| ) | ||
| r.Get("/", api.userOIDC) | ||
| }) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.