-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add ability to resolve signing key based on Jws embedded values before its signature is verified #8
Comments
I wonder if the signing key could be resolved from some knowledge in the Claims... The JWS spec states that a However, I wonder if some business-specific logic related to Claims inspection could also be used, and potentially more efficient. For example, maybe based on data that is already in the claims payload, one could infer/know the signing key. If this is true, the Thoughts? |
Yeah, I was debating whether to include the Claims or not, latest version showed without the Claims, because I was thinking in using the Also, since the the SignatureAlgorithm is already determined and asserted to be a valid one, I'll change the signature of the interface to return the Final version: public interface JwsSigningKeyResolver {
byte[] resolveSigningKey(JwsHeader header, Claims claims);
} |
… values before its signature is verified
…d. Added SigningKeyResolverAdapter.
Issue #8 Add ability to resolve signing key based on Jws embedded values...
Release notes updated and ready to go - closing this to release 0.4. |
Sometimes the signature key is embedded either in the JWT header or body, and therefore is useful to parse the JWT skipping the signature verification. Of course the verification must happen after getting the signature key.
If this is a valid approach the client is responsible of checking the signature after getting the values they need from the Jws.
A second approach would be to have a callback interface that if set will be called before the signature verification happens.
For example:
Probably can be call it if key is null and a implementation of the interface is specified when built a Jws Parser.
The text was updated successfully, but these errors were encountered: