An authentication handler is not configured to process the scheme: Microsoft.AspNet.Identity.Application

I am using ASP.NET Core with an ASP.NET ID and have the following:

User user = await _userManager.FindByEmailAsync(myEmail);

SignInResult result = await _signInManager.PasswordSignInAsync(user, myPassword, true, false);

I get a user, but when I try to log in, I get an error:

[Error] An unhandled exception has occurred while executing the request

System.InvalidOperationException: The authentication handler is not configured to handle the scheme: Microsoft.AspNet.Identity.Application

In the web project Run File, I have:

public void Configure(IApplicationBuilder applicationBuilder, IHostingEnvironment hostingEnvironment, ILoggerFactory loggerFactory) {

  // Other configuration code lines

  applicationBuilder.UseIISPlatformHandler(options => options.AuthenticationDescriptions.Clear());

  applicationBuilder.UseIdentity();

} // Configure

public void ConfigureServices(IServiceCollection services) {

  // Other configuration code lines

  services
    .AddIdentity<User, Role>()
    .AddEntityFrameworkStores<Context, Int32>()
    .AddDefaultTokenProviders();
}

I do not know what happened. I tried to change the configuration, and always get the same error ...

Any idea?

+4
source share
1 answer
applicationBuilder.UseIdentity(); 

- this is what cookie middleware should set up, make sure the string is called before being called

applicationBuilder.UseMvc()

mvc

+7

All Articles