-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Make X509CertificateThumbprintValidator
configurable through JwtValidators
create APIs
#17131
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
Comments
Thanks for the suggestion, @edmundham. (In case DPoP is what you are after, I'm including the link at the top. The explanation that follows assumes that this isn't what you are referring to) I agree that it could be helpful to have a validator that retrieved the JWKs from a JWKs URI.
I think there might be some confusion here, though. That request attribute is the result of a Servlet container (like Tomcat) validating proof-of-possession of a client cert's private key. For example, it's often the result of a successful mTLS handshake. It's not something to be "worked around", say, by populating that request attribute on your own. If the validator were to use a JWKs URI, it would only be to provide more options for obtaining the public JWK that the If you want to validate a In short, we could make this public, but there would still be a fair amount of work on your part to prove possession if you aren't planning on using the mTLS Alternativately, you can consider using Spring Security's DPoP support. This requires the client to provide a client-signed proof that accompanies the bearer token, removing the need for the resource server to rely on mTLS or ask the client to sign a nonce. DPoP verifies the client signature as well as the bearer token signature. Does it sound like one of these approaches will work for you? |
Hi @jzheaux , Thanks for the detailed explanation. Yes you are correct, I didn't really have full understanding of In the meantime it would still be better to have My intention is that I still want to use |
Great, @edmundham, let's take a look together. I'll close this in favor of #17178 |
Expected Behavior
X509CertificateThumbprintValidator should be public and without
final
OR it should expose some way to set customSupplier<X509Certificate>
Current Behavior
Currently,
X509CertificateThumbprintValidator
is built with theDefaultX509CertificateSupplier
. This is not configurable because:X509CertificateThumbprintValidator
is a default visibility with final classJwtValidators#createDefaultWithValidators
method doesn't really help, because we can't create our own customizedX509CertificateThumbprintValidator
because as I mentioned in # 1, it is final class with default visibilityjakarta.servlet.request.X509Certificate
request attribute but this isn't documented anywhereContext
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 newX509CertificateThumbprintValidator
in Spring Security 6. It seems like I can work around it withjakarta.servlet.request.X509Certificate
request attribute but ideally it should use JWKs URI that we pass in as part of buildingNimbusJwtValidator
The text was updated successfully, but these errors were encountered: