Closed
Description
Related to #7049
Summary
When using NimbusJwtDecoder.withSecretKey() to decode a JWT token that contains a kid the decoding always fails as the provided SecretKey does not match.
Actual Behavior
Signed JWT rejected: Another algorithm expected, or no matching key(s) found
is raised, because no match key is found (JWT token contains key, provided secret key not).
Expected Behavior
As I specify the public key to used, the jwt token should be tried to be verified using this key. There is no need to find a matching key.
Version
5.2.0.M2
Sample
SecretKey verificationKey = // ... some key
String token = "someTokenWithKid";
NimbusJwtDecoder decoder = NimbusJwtDecoder.withSecretKey(secretKey).build();
decoder.decode(token);