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

remove redefinition of providedCodeVerifier, fixed spelling #6

Merged
merged 1 commit into from
Sep 16, 2020

Conversation

HEllRZA
Copy link
Collaborator

@HEllRZA HEllRZA commented Sep 16, 2020

Signed-off-by: Bernd Eckstein [email protected]

@HEllRZA HEllRZA merged commit b23b855 into feature/PKCE Sep 16, 2020
HEllRZA added a commit that referenced this pull request Sep 16, 2020
Signed-off-by: Bernd Eckstein <[email protected]>
Signed-off-by: Bernd Eckstein <[email protected]>
HEllRZA added a commit that referenced this pull request Oct 26, 2020
* Basic implementation of PKCE

Signed-off-by: Tadeusz Magura-Witkowski <[email protected]>

* @mfmarche on 24 Feb: when code_verifier is set, don't check client_secret

In PKCE flow, no client_secret is used, so the check for a valid client_secret
would always fail.

Signed-off-by: Bernd Eckstein <[email protected]>

* @deric on 16 Jun: return invalid_grant when wrong code_verifier

Signed-off-by: Bernd Eckstein <[email protected]>

* Enforce PKCE flow on /token when PKCE flow was started on /auth
Also dissallow PKCE on /token, when PKCE flow was not started on /auth

Signed-off-by: Bernd Eckstein <[email protected]>

* fixed error messages when mixed PKCE/no PKCE flow.

Signed-off-by: Bernd Eckstein <[email protected]>

* server_test.go: Added PKCE error cases on /token endpoint

* Added test for invalid_grant, when wrong code_verifier is sent
* Added test for mixed PKCE / no PKCE auth flows.

Signed-off-by: Bernd Eckstein <[email protected]>

* cleanup: extracted method checkErrorResponse and type TestDefinition

* fixed connector being overwritten

Signed-off-by: Bernd Eckstein <[email protected]>

* /token endpoint: skip client_secret verification only for grand type authorization_code with PKCE extension

Signed-off-by: Bernd Eckstein <[email protected]>

* Allow "Authorization" header in CORS handlers

* Adds "Authorization" to the default CORS headers{"Accept", "Accept-Language", "Content-Language", "Origin"}

Signed-off-by: Bernd Eckstein <[email protected]>

* Add "code_challenge_methods_supported" to discovery endpoint

discovery endpoint /dex/.well-known/openid-configuration
now has the following entry:

"code_challenge_methods_supported": [
  "S256",
  "plain"
]

Signed-off-by: Bernd Eckstein <[email protected]>

* Updated tests (mixed-up comments), added a PKCE test

* @asoorm added test that checks if downgrade to "plain" on /token endpoint

Signed-off-by: Bernd Eckstein <[email protected]>

* remove redefinition of providedCodeVerifier, fixed spelling (#6)

Signed-off-by: Bernd Eckstein <[email protected]>
Signed-off-by: Bernd Eckstein <[email protected]>

* Rename struct CodeChallenge to PKCE

Signed-off-by: Bernd Eckstein <[email protected]>

* PKCE: Check clientSecret when available

In authorization_code flow with PKCE, allow empty client_secret on /auth and /token endpoints. But check the client_secret when it is given.

Signed-off-by: Bernd Eckstein <[email protected]>

* Enable PKCE with public: true

dex configuration public on staticClients now enables the following behavior in PKCE:
- Public: false, PKCE will always check client_secret. This means PKCE in it's natural form is disabled.
- Public: true, PKCE is enabled. It will only check client_secret if the client has sent one. But it allows the code flow if the client didn't sent one.

Signed-off-by: Bernd Eckstein <[email protected]>

* Redirect error on unsupported code_challenge_method

- Check for unsupported code_challenge_method after redirect uri is validated, and use newErr() to return the error.
- Add PKCE tests to oauth2_test.go

Signed-off-by: Bernd Eckstein <[email protected]>

* Reverted go.mod and go.sum to the state of master

Signed-off-by: Bernd Eckstein <[email protected]>

* Don't omit client secret check for PKCE

Signed-off-by: Bernd Eckstein <[email protected]>

* Allow public clients (e.g. with PKCE) to have redirect URIs configured

Signed-off-by: Martin Heide <[email protected]>

* Remove "Authorization" as Accepted Headers on CORS, small fixes

Signed-off-by: Bernd Eckstein <[email protected]>

* Revert "Allow public clients (e.g. with PKCE) to have redirect URIs configured"

This reverts commit b6e297b.

Signed-off-by: Martin Heide <[email protected]>

* PKCE on client_secret client error message

* When connecting to the token endpoint with PKCE without client_secret, but the client is configured with a client_secret, generate a special error message.

Signed-off-by: Bernd Eckstein <[email protected]>

* Output info message when PKCE without client_secret used on confidential client

* removes the special error message

Signed-off-by: Bernd Eckstein <[email protected]>

* General missing/invalid client_secret message on token endpoint

Signed-off-by: Bernd Eckstein <[email protected]>

Co-authored-by: Tadeusz Magura-Witkowski <[email protected]>
Co-authored-by: Martin Heide <[email protected]>
Co-authored-by: M. Heide <[email protected]>
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

Successfully merging this pull request may close these issues.

1 participant