Per the JWK Spec one of the keys have a “use” of verify. The ones Okta returns are all sig. I also tried getting the validation key from the authentication server via your dashboard. The key is that same as the one from the JWK endpoint.
What’s the correct way to get the validation key to validate the JWT returned from the token endpoint?
I managed to get it to work using okta-jwt-verifier, though the audience verification seems to be wrong. I had to enter the client ID rather than the audience value.
JwtVerifier jwtVerifier = new JwtHelper().setIssuerUrl(issuerUrl).setAudience(clientID).build();
The value for the audience field on my AS is set to “all”. Is this a known issue or am I suppose to use the client ID ?
I was able to retrieve the claims using the decodeAccessToken() method, I´ve replaced it with decodeIdToken() passing along the nonce param and it works.
‘n’ (modulus value of Public Key) and ‘e’ (exponent value of the Public key) are retrieved from the keys endpoint, the ‘kid’(key ID) should match the one in the id_token.