Description
JWT signature verification for id_token
fails in OidcAuthorizationCodeAuthenticationProvider
for OIDC providers like Ping Federate that have alternate signature verification rules.
From Ping Identity Developers Guide:
Note: Signature validation is only required for tokens not received directly from the token endpoint (i.e. for the Implicit Client Profile). In other cases where the id_token is received directly by the client from the token endpoint over HTTPS, transport layer security should be sufficient to vouch for the integrity of the token.
These rules are valid according to the OpenID Connect specification:
If the ID Token is received via direct communication between the Client and the Token Endpoint (which it is in this flow), the TLS server validation MAY be used to validate the issuer in place of checking the token signature. The Client MUST validate the signature of all other ID Tokens according to JWS [JWS] using the algorithm specified in the JWT alg Header Parameter. The Client MUST use the keys provided by the Issuer.
There is a method within OidcAuthorizationCodeAuthenticationProvider
to dynamically lookup a JwtDecoder
for a given ClientRegistration
:
private JwtDecoder getJwtDecoder(ClientRegistration clientRegistration) {
A few challenges here:
- That method is
private
- There is no way to plug in sublcasses or alternate mappings in the
.oauth2Login()
configuration DSL
As such, there need to be changes to the core classes to enable such pluggability.