OpenIdConnect nonce vs code verifier storage #65342
Replies: 1 comment
|
They protect different things, and the separate cookie is how this handler gives the OIDC nonce an independent, browser-bound, one-time lifecycle.
In ASP.NET Core's current The nonce takes another path:
This follows the OIDC requirement that, when a nonce was sent, the ID token must contain the same value and the client should detect replay. The spec deliberately leaves the storage method to the client; its implementation notes explicitly suggest a cryptographically random HttpOnly session cookie for a web client: OIDC Core, nonce validation and implementation notes. PKCE has a different protocol role, described in RFC 7636: the verifier proves possession when redeeming the authorization code. Could a different implementation carry nonce-related state inside a protected So the separate cookie is not evidence that protected If this answers the design question, please mark it as the accepted answer so future readers can find it quickly. |
Uh oh!
There was an error while loading. Please reload this page.
Looking at the OpenIdConnectHandler implementation the "state" passed through to the idp is an encrypted value containing amongst other things the pkce code_verifier later used to exchange code for tokens, and a correlation id also stored in cookie and used to prevent csrf. What I'm trying to understand is why is the "nonce" stored in a whole separate cookie VS passing it inside of the encrypted state so it can be read back on the callback (given that is how the code_verifier is passed through)? Is there any security implications in embedding the nonce into encrypted state?
All reactions