asp.net core - No authentication handler is configured to handle the scheme: Microsoft.AspNet.Identity.Application -


i using asp.net core asp.net identity , have following:

user user = await _usermanager.findbyemailasync(myemail);  signinresult result = await _signinmanager.passwordsigninasync(user, mypassword, true, false); 

i user when try sign in user error:

[error] unhandled exception has occurred while executing request 

system.invalidoperationexception: no authentication handler configured handle scheme: microsoft.aspnet.identity.application

on web project startup file 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 have no idea wrong. tried change configuration , same error ...

any idea?

applicationbuilder.useidentity();  

is should configure cookie middleware, make sure line called before calling

applicationbuilder.usemvc() 

authentication must configured before mvc


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -