RequireNonce is true (default) but validationContext.Nonce is null

25.2k views Asked by At

I have an app running in azure using Azure active directory. Some of the users have just reported getting this error trying to access the app. I can access it ok, so can many other users, its only certain users that are having the issue, heres the error message

IDX10311: RequireNonce is true (default) but validationContext.Nonce is null. A Nonce cannot be validated. If you dont need to check the nonce, set OpenIdConnectProtocolValidator.RequireNonce to false

Ive googled it but I cant find a solution, has anyone else experienced this problem ? How Can I fix it ?

2

There are 2 answers

0
Abdulqadir Galan On

Error: IDX21323: RequireNonce is '[PII is hidden. For more details, see https://aka.ms/IdentityModel/PII.]'. 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.

Resolution: i recreate visual studio virtual directory. i notice while i rebuild the solution there was access denied for the virtual directory. i create new virtual directory by using the project property and the error is gone.

1
Raja Mouli Ankireddy On

I had the same problem but switching back the Microsoft.Owin.Security.OpenIdConnect to version 3.0.1 solved the issue

OWIN OpenIdConnect Middleware IDX10311 nonce cannot be validated