0

Whenever I use Sitecore's getsignonurl and signin, I am sucessfully authenticated everything works fine.

However, when I use the authentication challenge, User.Identity.IsAuthentication is false. But, the OpenIdConnectAuthenticationNotifications shows as authenticated and and even the nonce is present.

enter image description here

enter image description here The error logs shows:

Exception: Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectProtocolInvalidNonceException
Message: IDX21323: RequireNonce is '[PII is hidden]'. 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.
Source: Microsoft.IdentityModel.Protocols.OpenIdConnect
   at Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectProtocolValidator.ValidateNonce(OpenIdConnectProtocolValidationContext validationContext) in C:\agent2\_work\15\s\src\Microsoft.IdentityModel.Protocols.OpenIdConnect\OpenIdConnectProtocolValidator.cs:line 639
   at Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectProtocolValidator.ValidateAuthenticationResponse(OpenIdConnectProtocolValidationContext validationContext) in C:\agent2\_work\15\s\src\Microsoft.IdentityModel.Protocols.OpenIdConnect\OpenIdConnectProtocolValidator.cs:line 264
   at Microsoft.Owin.Security.OpenIdConnect.OpenIdConnectAuthenticationHandler.<AuthenticateCoreAsync>d__1a.MoveNext()

Any Insights or suggestions?

2
  • I am also facing the same issue. Did you find any solution ?
    – Siddharth
    Commented Mar 3, 2022 at 13:45
  • Hi @Siddharth as you can see from the screenshot, AuthenticationType is ExternalCookie so I did this: var authenticated = HttpContext.GetOwinContext().Authentication.AuthenticateAsync("ExternalCookie");
    – manaslu
    Commented Mar 3, 2022 at 19:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.