Questions tagged [jwk]

A JSON Web Key is a JSON data structure that represents a cryptographic key.

A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key.

The specification for this structure is in RFC 7517.

218 questions
81
votes
7 answers

Verifying JWT signed with the RS256 algorithm using public key in C#

Ok, I understand that the question I am asking may be pretty obvious, but unfortunately I lack the knowledge on this subject and this task seems to be quite tricky for me. I have an id token (JWT) returned by OpenID Connect Provider. Here it…
Dmitry Nikolaev
  • 3,803
  • 2
  • 19
  • 23
29
votes
3 answers

How to verify JWT signature with JWK in Go?

I have been searching for an example I can understand of how to validate the signature of a JWT with the Go Language. This might be especially tricky since I am using Okta, and it uses JWKs, so it is not especially straight forward. When I receive a…
user3888307
  • 2,825
  • 5
  • 22
  • 32
21
votes
2 answers

Where does jwt.io get the public key from JWT token?

I was decoding a JWT token via jwt.io (in the Debugger section) to see Headers, Payload. Surprisingly, it also verified, and I could see it (jwt.io debugger) is able to retrieve the public key as well. So my question is: Does JWT token provide the…
CuriousMind
  • 8,301
  • 22
  • 65
  • 134
19
votes
3 answers

How to validate AWS Cognito JWT in .NET Core Web API using .AddJwtBearer()

I was having some trouble figuring out how to go about validating a JWT given to the client by AWS Cognito inside my .NET Core Web API. Not only could I not figure out what the variables for Microsoft.IdentityModel.Tokens.TokenValidationParameters…
foxtrotuniform6969
  • 3,527
  • 7
  • 28
  • 54
18
votes
2 answers

When does JWK expire? JWKS rotation policy

I am reading about JWKS and found information about the key rotation concept - https://developer.okta.com/docs/concepts/key-rotation/ Let's assume I use JWKS in my application but I don't fetch them periodically, so just hardcoded. The single key…
maxi175
  • 313
  • 3
  • 7
17
votes
3 answers

How to properly consume OpenID Connect jwks_uri metadata in C#?

OpenID Connect discovery documents typically include a jwks_uri property. The data returned from the jwks_uri seems to take on at least two different forms. One form contains fields called x5c and x5t. An example of this looks like: { "keys": [ …
Rob L
  • 3,073
  • 6
  • 31
  • 61
15
votes
1 answer

How to obtain JWKs and use them in JWT signing?

I am reading this blog about JWTs and how you can use the signature part of it to verify that the token was actually issued by the trusted party. https://hackernoon.com/json-web-tokens-jwt-demystified-f7e202249640 The JSON Web Key (JWK) is a JSON…
Ihor M.
  • 2,728
  • 3
  • 44
  • 70
15
votes
6 answers

How to convert a public key from a JWK into PEM for OpenSSL?

There is an RSA key from an RFC: https://www.rfc-editor.org/rfc/rfc7516#appendix-A.1 {"kty":"RSA", "n":"oahUIoWw0K0usKNuOR6H4wkf4oBUXHTxRvgb48E-BVvxkeDNjbC4he8rUW cJoZmds2h7M70imEVhRU5djINXtqllXI4DFqcI1DgjT9LewND8MW2Krf3S …
Velkan
  • 7,067
  • 6
  • 43
  • 87
12
votes
1 answer

What is the difference between JOSE, JWA, JWE, JWK, JWS and JWT?

What is the difference between JOSE, JWA, JWE, JWK, JWS and JWT and how are they related to one another?
Marco
  • 5,555
  • 2
  • 17
  • 23
12
votes
2 answers

Manually create JWK from (RSA) PublicKey

I need to convert a RSA PublicKey into a valid JWK. Especially the values "n" an "e" of the JWK are the ones I'm struggling with. The encoding does not seem to be correct, when looking at example JWK's at…
KevKosDev
  • 811
  • 2
  • 9
  • 31
10
votes
2 answers

JWK Key Creation with x5c and x5t parameters

I have the need to generate a JWK with the following parameters: “kty”: Key Type “kid”: Key ID “use”: “sig” Public Key Use “n”: the modulus “e”: “AQAB” the public exponent “x5c”: X. 509 Certificate Chain “x5t”: X.509 Certificate SHA-1…
GregH
  • 5,125
  • 8
  • 55
  • 109
10
votes
4 answers

How to increase RemoteJWKSet cache TTL in spring-security 5.2

We are using spring-security 5.2 for securing our REST API through JWT validation. With the spring:security:oauth2:resourceserver:jwt:jwk-set-uri property we indicate the remote JWKS endpoint which translates into Spring creating a NimbusJwtDecoder…
chirina
  • 133
  • 2
  • 8
9
votes
1 answer

What does "e": "AQAB" mean in jwks?

What does "e": "AQAB" mean in JWKS - Json Web Key Set { "keys": [ { "kty": "RSA", #key type "e": "AQAB", #Question - what does "e" mean or stand for. And what values can e take. What is AQAB here. "use": "sig", #verify…
samshers
  • 1
  • 6
  • 37
  • 84
9
votes
1 answer

How to validate JWT Token using JWKS in Dot Net Core

In C#, I need to validate the Bearer Token against the JWKS (Json object which represent the set of keys like below) { "keys":[ { "e":"AQAB", "kid":"unique key", "kty":"RSA", "n":"some value" } …
Anandaraj
  • 91
  • 1
  • 1
  • 3
9
votes
2 answers

Decoding Base64urlUInt-encoded value

What I am generally trying to do, is to validate an id_token value obtained from an OpenID Connect provider (e.g. Google). The token is signed with the RSA algorithm and the public key is read from the Discovery document (the jwks_uri parameter).…
Dmitry Nikolaev
  • 3,803
  • 2
  • 19
  • 23
1
2 3
14 15