Hi All,
We have integrated Orchard CMS application from ADFS to Azure Authentication and whenever login OR doing any operation in admin page we are getting Nonce issue. Can you please help to resolve this issue, we tried multiple way like installing NuGet package 'Kentor.OwinCookieSaver', setting flag on chrome to disabled, AD App Registrations with Reply URL and Start URL,.. etc.
Bellow is the error details-
"Server Error in '/' Application.
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.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectProtocolInvalidNonceException: 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 Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[OpenIdConnectProtocolInvalidNonceException: 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.]
Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectProtocolValidator.ValidateNonce(OpenIdConnectProtocolValidationContext validationContext) +1013
Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectProtocolValidator.ValidateAuthenticationResponse(OpenIdConnectProtocolValidationContext validationContext) +263
Microsoft.Owin.Security.OpenIdConnect.<AuthenticateCoreAsync>d__11.MoveNext() +4494"
@AmadeuAntunes I'm using InitializedAsync
in my project to initialize fields like this:
if (!string.IsNullOrEmpty(supplierId))
{
context.ContentItem.Alter<Product>(x => x.Supplier = new ContentPickerField() { ContentItemIds = new string[] { supplierId } });
}
Try using Alter
on one field and see if that works.
Has anyone seen exceptions like this?
2021-02-25 15:53:56.5761|Default||ee0e8ec7-4408a06d78677750.||Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware|ERROR|An unhandled exception has occurred while executing the request. System.ArgumentNullException: Value cannot be null. (Parameter 'key')
at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at SixLabors.ImageSharp.Web.Resolvers.PhysicalFileSystemCacheResolver.OpenReadAsync()
at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.SendResponseAsync(ImageContext imageContext, String key, ImageCacheMetadata metadata, Stream stream, IImageCacheResolver cacheResolver)
at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.<>c__DisplayClass21_0.<<IsNewOrUpdatedAsync>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.IsNewOrUpdatedAsync(IImageResolver sourceImageResolver, ImageContext imageContext, String key)
at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.ProcessRequestAsync(HttpContext context, IImageResolver sourceImageResolver, ImageContext imageContext, IDictionary`2 commands)
at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at OrchardCore.Diagnostics.DiagnosticsStartupFilter.<>c__DisplayClass3_0.<<Configure>b__1>d.MoveNext() in D:\GitHub\www.t-shirtskempen.be\src\OrchardCore.Modules\OrchardCore.Diagnostics\DiagnosticsStartupFilter.cs:line 47
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task) at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at SixLabors.ImageSharp.Web.Resolvers.PhysicalFileSystemCacheResolver.OpenReadAsync()
at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.SendResponseAsync(ImageContext imageContext, String key, ImageCacheMetadata metadata, Stream stream, IImageCacheResolver cacheResolver)
at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.<>c__DisplayClass21_0.<<IsNewOrUpdatedAsync>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.IsNewOrUpdatedAsync(IImageResolver sourceImageResolver, ImageContext imageContext, String key)
at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.ProcessRequestAsync(HttpContext context, IImageResolver sourceImageResolver, ImageContext imageContext, IDictionary`2 commands)
at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at OrchardCore.Diagnostics.DiagnosticsStartupFilter.<>c__DisplayClass3_0.<<Configure>b__1>d.MoveNext() in D:\GitHub\www.t-shirtskempen.be\src\OrchardCore.Modules\OrchardCore.Diagnostics\DiagnosticsStartupFilter.cs:line 47
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
I'm not sure where to start looking?
<script At="Foot" depends-on="jQuery">...</script>
in the output. Any ideas?