Ich bin mit ASP.NET Identität mit ASP.NET Kern zu handhaben, und ich habe:keine Authentifizierung Handler konfiguriert ist, das Schema Microsoft.AspNet.Identity.Application
services.AddIdentity<User, Role>();
Das funktioniert gut, wenn ich anmelden. Aber dann habe ich versucht, dieses Setup:
services
.AddIdentity<User, Role>(x => {
x.Cookies = new IdentityCookieOptions {
ApplicationCookie = new CookieAuthenticationOptions {
AccessDeniedPath = new PathString("/signin"),
AuthenticationScheme = "cookies",
AutomaticAuthenticate = true,
AutomaticChallenge = true,
CookieName = "_ath",
LoginPath = new PathString("/signin"),
LogoutPath = new PathString("/signout")
}
};
})
.AddEntityFrameworkStores<Context, Int32>()
.AddDefaultTokenProviders();
Damit ich die folgende Fehlermeldung erhalten:
No authentication handler is configured to handle the scheme:
Microsoft.AspNet.Identity.Application
Bitte beachte, dass ich AuthenticationScheme = "cookies"
, AutomaticAuthenticate = true
und AutomaticChallenge = true
.
Ich habe auch die folgende in Starttup/Configure-Methode:
applicationBuilder
.UseIdentity()
.UseMvc(routes => { routes.MapRoute(name: "default", template: "{controller=Home}/{action=Index}/{id?}"); })
So nehme ich mir die Standard-Bestellung ... bin mit
Hat jemand weiß, was bin ich dabei?
Leider hilft mir das nicht, weil ich das schon habe. Ich habe den Code meiner Frage aktualisiert, um es zu reflektieren ... –