OpenID Connect Nonce vs JWT ID Jti
Fleeting- External reference: https://security.stackexchange.com/questions/188166/why-does-openid-connect-oidc-use-a-nonce-claim-instead-of-the-jti-regist
- see,
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.