Skip to content

Make X509CertificateThumbprintValidator configurable through JwtValidators create APIs #17131

Closed
@edmundham

Description

@edmundham

Expected Behavior

X509CertificateThumbprintValidator should be public and without final OR it should expose some way to set custom Supplier<X509Certificate>

Current Behavior
Currently, X509CertificateThumbprintValidator is built with the DefaultX509CertificateSupplier. This is not configurable because:

  1. X509CertificateThumbprintValidator is a default visibility with final class
  2. JwtValidators#createDefaultWithValidators method doesn't really help, because we can't create our own customized X509CertificateThumbprintValidator because as I mentioned in # 1, it is final class with default visibility
  3. It doesn't really use JWKs URI either that could have been passed by the other parameter when building NimbusJwtDecoder
  4. Only way is through jakarta.servlet.request.X509Certificate request attribute but this isn't documented anywhere

Context

The token I'm decoding has cnf claim and since I've upgraded to Spring Boot 3 (spring security 6), it's broken due to new X509CertificateThumbprintValidator in Spring Security 6. It seems like I can work around it with jakarta.servlet.request.X509Certificate request attribute but ideally it should use JWKs URI that we pass in as part of building NimbusJwtValidator

Metadata

Metadata

Assignees

Labels

in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)status: duplicateA duplicate of another issuetype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions