I found an odd behavior with JWT parsing and JwtValidators.
Scenario:
JwtDecoderFacotry<ClientRegistration>
for ID-Token validationJwtValidatorFactory
based on JwtValidators.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 by JwtValidators.createDefaultWithIssuer(String)
) wraps a JwtClaimValidator<String>
.equals()
that is always false
- it compares String with URL.My current workaround is not calling JwtValidators.createDefaultWithIssuer()
but just using the validators new JwtTimestampValidator()
and an own implementation of OAuth2TokenValidator<Jwt>
(with wrapping JwtClaimValidator<URL>
).
Anyone else having trouble with this?
--Christian
It's a bug. Pull Request is created.