Bug with JwtValidators.createDefaultWithIssuer(String)? #9136
Labels
in: oauth2
An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)
type: bug
A general bug
Milestone
I found an odd behavior with JWT parsing and JwtValidators.
Scenario:
JwtDecoderFacotry<ClientRegistration>
for ID-Token validationJwtValidatorFactory
based onJwtValidators.createDefaultWithIssuer(String)
This worked well with Spring Boot version <= 2.2.10.
Debugging:
NimbusJwtDecoder
(JAR spring-security-oauth2-jose) uses claim set converters. The 'iss' (issuer) claim is handled as URL.JwtIssuerValidator
(internally created byJwtValidators.createDefaultWithIssuer(String)
) wraps aJwtClaimValidator<String>
.equals()
that is alwaysfalse
- it compares String with URL.My current workaround is not calling
JwtValidators.createDefaultWithIssuer()
but just using the validators newJwtTimestampValidator()
and an own implementation ofOAuth2TokenValidator<Jwt>
(with wrappingJwtClaimValidator<URL>
).Anyone else having trouble with this?
--Christian
The text was updated successfully, but these errors were encountered: