.NET IDX21323 Error
Last Updated:
Overview
This article explains the cause of the following error:
IDX21323: RequireNonce is 'True'. OpenIdConnectProtocolValidationContext.Nonce was null, OpenIdConnectProtocol.ValidatedIdToken.Payload.Nonce was not null. The nonce cannot be validated. If you don't need to check the nonce, set OpenIdConnectProtocolValidator.RequireNonce to 'false'. Note if a 'nonce' is found it will be evaluated.
Applies To
- .NET IDX21323
- Nonce Cookie
Cause
The error is due to the nonce cookie not being present in the request as indicated by 'OpenIdConnectProtocolValidationContext.Nonce was null'.
Solution
There is one caveat for old browsers: the None option isn't defined. If explicitly set, it will be treated as strict, forcing the browser to drop the nonce cookie. The following Microsoft Documentation has a solution in a sample function named DisallowsSameSiteNone: SameSite cookies and the Open Web Interface for .NET (OWIN).