Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Security] Support for OIDC token handler with discovery endpoint #51490

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

Closed
guillaumesmo opened this issue Aug 26, 2023 · 2 comments
Closed

[Security] Support for OIDC token handler with discovery endpoint #51490

guillaumesmo opened this issue Aug 26, 2023 · 2 comments

Comments

@guillaumesmo
Copy link
Contributor

guillaumesmo commented Aug 26, 2023

Description

Although the new OidcTokenHandler is a great step forward, I believe the name is confusing because it's just validating a simple JWT token (as defined by RFC 7519) and not really using the advantages of OIDC.

Every OIDC issuer (eg https://securetoken.google.com/helloworld) has a corresponding discovery endpoint which is conveniently accessible by appending .well-known/openid-configuration (eg https://securetoken.google.com/helloworld/.well-known/openid-configuration)

The OIDC token handler should accept a simple issuer, load the list of keys from jwks_uri property of the discovery endpoint, ideally cache those keys for a short amount of time and validate the JWT token against those.

The advantages are a simpler configuration for the developer (only issuer & claim needs to be configured) and issuer can change the endpoints or execute key rotations without the need to reconfigure the client applications. Please note that once the keys are cached, this method doesn't need to issue any HTTP requests to validate the token.

Some OIDC discovery endpoints (eg https://accounts.google.com/.well-known/openid-configuration or https://e2emerchant.itsme.be/oidc/.well-known/openid-configuration) contain more information, like userinfo_endpoint which is already used in the OidcUserInfoTokenHandler (but without support for the discovery endpoint), support for token revocation and also the actual login flow configuration which might also be used for stateful firewalls.

Also an important distinction is that in OIDC the claims are stored in the ID token, while the current implementation is validating the access token only. Most of the time they are identical, but in fact, OIDC access tokens might not even be a JWT.

In my opinion the OidcTokenHandler should be renamed to JwtTokenHandler

Example

No response

@raziel057
Copy link
Contributor

@xabbuh xabbuh added the Feature label Sep 4, 2023
@chalasr
Copy link
Member

chalasr commented Sep 17, 2023

Closing as duplicated of #50433. Inputs are welcome there.

@chalasr chalasr closed this as completed Sep 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants