Closed
Description
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:
public interface JwsSignatureKeyResolver {
Key resolveSignatureKey(JwsHeader header, Claims claims);
}
Probably can be call it if key is null and a implementation of the interface is specified when built a Jws Parser.