%3CLINGO-SUB%20id%3D%22lingo-sub-501105%22%20slang%3D%22en-US%22%3ESolutions%20for%20%E2%80%9CIDX10311%20RequireNonce%20is%20true%E2%80%9D%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-501105%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSTRONG%3E%E2%80%9C%3C%2FSTRONG%3E%3CSTRONG%3EIDX10311%20RequireNonce%20is%20true%E2%80%9D%3C%2FSTRONG%3E%20error%20occurs%20when%20an%20application%20is%20not%20able%20authenticate%20via%20Azure%20AD%20due%20to%20nonce%20cookie%20related%20issues.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20error%20message%20displayed%20is%3A%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3EIDX10311%3A%20RequireNonce%20is%20%E2%80%98true%E2%80%99%20(default)%20but%20validationContext.Nonce%20is%20null.%20A%20nonce%20cannot%20be%20validated.%20If%20you%20don%E2%80%99t%20need%20to%20check%20the%20nonce%2C%20set%20OpenIdConnectProtocolValidator.RequireNonce%20to%20%E2%80%98false%E2%80%99.%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20638px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F111013i3C871AA831DAC604%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%221.jpg%22%20title%3D%221.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPossible%20root%20cause%20is%20that%20the%20nonce%20cookie%20is%20missing%20or%20altered%20during%20the%20authentication%20with%20AAD.%3C%2FP%3E%0A%3CP%3EPlease%20note%20that%20it%20is%20normal%20for%20application%20to%20throw%20this%20error%20if%20user%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%20style%3D%22font-weight%3A%20400%3B%22%3EClicks%20browser%E2%80%99s%20Back%20button%20and%20authenticates%20again%3C%2FLI%3E%0A%3CLI%20style%3D%22font-weight%3A%20400%3B%22%3ETries%20to%20login%20after%20a%20long%20time%20of%20inactivity%3C%2FLI%3E%0A%3CLI%20style%3D%22font-weight%3A%20400%3B%22%3EUses%20the%20site%20in%20multiple%20tabs%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EIn%20these%20cases%2C%20it%20is%20better%20to%20implement%20a%20code%20block%20to%20catch%20this%20exception%20and%20redirect%20the%20user%20accordingly.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1730501558%22%20id%3D%22toc-hId-1730501558%22%3ESolution%3C%2FH2%3E%0A%3CP%3EIn%20my%20case%2C%20the%20error%20occurred%20because%20the%20claim%20policy%20was%20not%20applied%20in%20Azure%20AD.%20Applying%20this%20policy%20solved%20the%20issue.%20If%20this%20doesn%E2%80%99t%20solve%20the%20issue%20in%20your%20case%2C%20please%20try%20the%20following%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%20style%3D%22font-weight%3A%20400%3B%22%3ECheck%20%E2%80%9C%3CSTRONG%3EHome%20page%20URL%3C%2FSTRONG%3E%E2%80%9D%20and%20%E2%80%9C%3CSTRONG%3EReply%20URL%3C%2FSTRONG%3E%E2%80%9D%20on%20Azure%20portal.%20They%20should%20be%20the%20same%3C%2FLI%3E%0A%3CLI%20style%3D%22font-weight%3A%20400%3B%22%3EMake%20sure%20that%20the%20site%20is%20in%20Intranet%20Zone%20in%20IE%3C%2FLI%3E%0A%3CLI%20style%3D%22font-weight%3A%20400%3B%22%3ECheck%20if%20the%20application%20has%20multiple%20redirections%3C%2FLI%3E%0A%3CLI%20style%3D%22font-weight%3A%20400%3B%22%3EDelete%20cookies%20on%20the%20client%20side%20and%20restart%20Azure%20site%3C%2FLI%3E%0A%3CLI%20style%3D%22font-weight%3A%20400%3B%22%3EFor%20further%20troubleshooting%2C%20collect%20Fiddler%20trace%20to%20check%20nonce%20cookies%3C%2FLI%3E%0A%3C%2FUL%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-501105%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSTRONG%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoeui%26amp%3Bquot%3B%2C%26amp%3Bquot%3Blato%26amp%3Bquot%3B%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Carial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20bold%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3E%E2%80%9C%3C%2FSTRONG%3E%3CSTRONG%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoeui%26amp%3Bquot%3B%2C%26amp%3Bquot%3Blato%26amp%3Bquot%3B%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Carial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20bold%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3EIDX10311%20RequireNonce%20is%20true%E2%80%9D%3C%2FSTRONG%3E%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20%23ffffff%3B%20color%3A%20%23333333%3B%20cursor%3A%20text%3B%20font-family%3A%20inherit%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20line-height%3A%201.7142%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3E%20error%20occurs%20when%20an%20application%20is%20not%20able%20authenticate%20via%20Azure%20AD%20due%20to%20nonce%20cookie%20related%20issues.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E
Microsoft

IDX10311 RequireNonce is true” error occurs when an application is not able authenticate via Azure AD due to nonce cookie related issues.

 

The error message displayed is:

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

1.jpg

 

Possible root cause is that the nonce cookie is missing or altered during the authentication with AAD.

Please note that it is normal for application to throw this error if user

 

  • Clicks browser’s Back button and authenticates again
  • Tries to login after a long time of inactivity
  • Uses the site in multiple tabs

In these cases, it is better to implement a code block to catch this exception and redirect the user accordingly.

 

Solution

In my case, the error occurred because the claim policy was not applied in Azure AD. Applying this policy solved the issue. If this doesn’t solve the issue in your case, please try the following:

  • Check “Home page URL” and “Reply URL” on Azure portal. They should be the same
  • Make sure that the site is in Intranet Zone in IE
  • Check if the application has multiple redirections
  • Delete cookies on the client side and restart Azure site
  • For further troubleshooting, collect Fiddler trace to check nonce cookies