Skip to content

Conversation

@elffjs
Copy link
Member

@elffjs elffjs commented Dec 9, 2021

Overview

What this PR does / why we need it

Special notes for your reviewer

Does this PR introduce a user-facing change?


@elffjs elffjs merged commit 6d9ab34 into master Dec 9, 2021
@elffjs elffjs deleted the token-direct branch December 20, 2021 15:37
elffjs pushed a commit that referenced this pull request Jun 27, 2022
* 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]>
elffjs added a commit that referenced this pull request Jun 27, 2022
For the Web3 flow, return the authorization token directly
elffjs added a commit that referenced this pull request Aug 17, 2022
For the Web3 flow, return the authorization token directly
elffjs added a commit that referenced this pull request Nov 8, 2022
For the Web3 flow, return the authorization token directly
elffjs added a commit that referenced this pull request Apr 4, 2023
For the Web3 flow, return the authorization token directly
elffjs added a commit that referenced this pull request May 16, 2024
For the Web3 flow, return the authorization token directly
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.

2 participants