Is your feature request related to a problem? Please describe.
If JwtParser#parseSignedClaims call results into SignatureException, it's not possible to parse the JWS header or claims from the exception. This would be useful for collecting metrics per key id and audit logging, when you could log the already parsed header and claims.
Describe the solution you'd like
Similar to ExpiredJwtException#getHeader() and #getClaims(), SignatureException could also have those methods.
I realize the methods are missing probably because this could be quite dangerous if used wrong, but maybe the methods could be named with dangerously prefix to signify the inherent danger in using the return values...?
Describe alternatives you've considered
Decoding the JWS parts myself, but this seems like a waste, when the work to parse the token has already been done by JJWT.
Additional context
JJWT version 0.12.6
Is your feature request related to a problem? Please describe.
If
JwtParser#parseSignedClaimscall results intoSignatureException, it's not possible to parse the JWS header or claims from the exception. This would be useful for collecting metrics per key id and audit logging, when you could log the already parsed header and claims.Describe the solution you'd like
Similar to
ExpiredJwtException#getHeader()and#getClaims(),SignatureExceptioncould also have those methods.I realize the methods are missing probably because this could be quite dangerous if used wrong, but maybe the methods could be named with
dangerouslyprefix to signify the inherent danger in using the return values...?Describe alternatives you've considered
Decoding the JWS parts myself, but this seems like a waste, when the work to parse the token has already been done by JJWT.
Additional context
JJWT version 0.12.6