0

I have a JWKS-generated JWT that I need to validate. Due to connectivity reasons, I can't pull the key info from the server directly. So I got the info manually, and would like to plug it into my Spring Boot app to validate my JWT. But I can't find very many examples not using Auth0 to get the key.

So what I have from the site giving me the JWT is this:

"keys": [{
    "kty": "RSA",
    "kid": "testJWT",
    "use": "sig",
    "alg": "RSA",
    "n": "wEYJ85moXdpZT2vEW-jaeJrJnYqHumQpeakzyQJ0BJXDE3rZnxs17bLd_...",
    "e": "AQAB"
}]

I've seen a lot of examples pass in a public key, but from the json, I can't tell what the public key is. Is it the "n"?? Do I need to decode it (I get garbage when I do)? I would love it if someone could post a short snippet of the values I need.

CNDyson
  • 1,687
  • 7
  • 28
  • 63
  • Does this answer your question? [Generating Public Key from JWK](https://stackoverflow.com/questions/66389070/generating-public-key-from-jwk) – jps Jun 17 '22 at 14:56
  • Almost - that codes generates a key. I'm using one already provided. I just don't know how to construct it. – CNDyson Jun 17 '22 at 14:58
  • [n and e are modulus and exponent](https://stackoverflow.com/questions/67821481/can-anyone-explain-what-keys-are-in-dict-of-jwk-when-generating-key) of the public key and the *garbage* you get after decoding is no garbage but binary data. – jps Jun 17 '22 at 14:58
  • Ok, do you have an example as to how to use that data? – CNDyson Jun 17 '22 at 14:59
  • in the linked Q/A, the example in the question is showing how to import a JWK and use the values to get a public key that you can use to veriify. – jps Jun 17 '22 at 15:01

0 Answers0