I am trying to run my ASP.NET Core 3.1 MVC web application with Azure AD authentication using HTTP (not HTTPS).
But I am getting this error:
An unhandled exception occurred while processing the request.
Exception: Correlation failed.
Unknown locationException: An error was encountered while handling the remote login. Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler.HandleRequestAsync()
I have the http URL specified in Azure application authentication setting as well. In Startup.cs below code is setting the authentication
services.AddAuthentication(AzureADDefaults.AuthenticationScheme)
.AddAzureAD(options => Configuration.Bind("AzureAd", options));
services.Configure<OpenIdConnectOptions>(AzureADDefaults.OpenIdScheme, (OpenIdConnectOptions options) =>
{
options.ResponseType = OpenIdConnectResponseType.CodeIdToken;
options.Events.OnAuthorizationCodeReceived = OnAuthorizationCodeReceived;
});
Please suggest.