java.lang.NoSuchMethodError: com.nimbusds.jose.jwk.KeyType.forAlgorithm(Lcom/nimbusds/jose/Algorithm;)Lcom/nimbusds/jose/jwk/KeyType;

Hi,

I have this code to verify my token
private static final ConfigurableJWTProcessor JWT_PROCESSOR = new DefaultJWTProcessor();

String accessToken = req.getParameter(“access_token”);
SecurityContext ctx =null;
JWTClaimsSet claimsSet = JWT_PROCESSOR.process(accessToken, ctx);

The above line fails with error

java.lang.NoSuchMethodError: com.nimbusds.jose.jwk.KeyType.forAlgorithm(Lcom/nimbusds/jose/Algorithm;)Lcom/nimbusds/jose/jwk/KeyType;
at com.nimbusds.jose.proc.JWSVerificationKeySelector.createJWKMatcher(JWSVerificationKeySelector.java:78)
at com.nimbusds.jose.proc.JWSVerificationKeySelector.selectJWSKeys(JWSVerificationKeySelector.java:105)
at com.nimbusds.jwt.proc.DefaultJWTProcessor.process(DefaultJWTProcessor.java:274)
at com.nimbusds.jwt.proc.DefaultJWTProcessor.process(DefaultJWTProcessor.java:235)

I have the jar file nimbus-jose-jwt-4.16.2.jar in my class path and when unzip the are, access the class, i can see the forAlgorithm method.

Request your inputs please.

I am generating this token using Postman , by giving the correct tenant informatin.

Thanks

I have this jar - nimbus-jose-jwt-4.16.2.jar in my class path, but still errors out