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) {
applicationBuilder.UseIISPlatformHandler(options => options.AuthenticationDescriptions.Clear());
applicationBuilder.UseIdentity();
}
public void ConfigureServices(IServiceCollection services) {
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?
source
share