3

According to the spec, OpenID Connect uses nonce as the registered claim name, but RFC 7519 already includes a registered claim named jti for this same purpose.

Was this an oversight, or was there something wrong with the way jti was specified (or implemented)?

Is there a mailing list entry within OpenId where I could find this information?

1 Answer 1

6

The jti (JWT ID) is chosen by the authentication server in order to identify a token. As per OpenID Connect, section 9:

JWT ID. A unique identifier for the token, which can be used to prevent reuse of the token. These tokens MUST only be used once, unless conditions for reuse were negotiated between the parties; any such negotiation is beyond the scope of this specification.

The nonce is chosen by the application and passed as a parameter in the authentication request.

String value used to associate a Client session with an ID Token, and to mitigate replay attacks. The value is passed through unmodified from the Authentication Request to the ID Token. If present in the ID Token, Clients MUST verify that the nonce Claim Value is equal to the value of the nonce parameter sent in the Authentication Request. If present in the Authentication Request, Authorization Servers MUST include a nonce Claim in the ID Token with the Claim Value being the nonce value sent in the Authentication Request. Authorization Servers SHOULD perform no other processing on nonce values used. The nonce value is a case sensitive string.

So they serve different purposes. And the nonce predates JWT bindings in OAuth2 (although very vaguely defined), and applies even if you use opaque token strings.

Another answer here explains the difference between the state and nonce parameters.

2
  • Does that mean that the value provided for the nonce claim is supplied in the request (by the relying party) for a JWT and the OP (IdP) uses the requestor's value when creating the JWT? Is this similar to how the state query param is used in OAuth 2.0 "Authorization Grant" flows?
    – Jon Wolski
    Jun 21, 2018 at 15:36
  • 1
    The use of nonces in Oauth2 was much less clear than I thought I remembered. I updated my answer with a bit more description, and linked in a similar question on SE. Jun 22, 2018 at 6:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.