Ich bin auf der Suche nach ASP.net Authentifizierung über den SignInManager, aber ohne die EntityFramework zu implementieren. Ich habe meine eigene Datenbankschicht mit SQLClient erstellt und möchte nur die erforderlichen Aufrufe erstellen, damit die ASP.net-Authentifizierung funktioniert.Wie man ASP.net Core 1 "SignInManager" ohne EntityFramework verwendet
Der Code, den ich habe, ist als (von der Startup.cs ausgeführt) folgt:
// Add EF services to the services container.
services.AddEntityFramework()
.AddSqlServer()
.AddDbContext<OAuthAppDbContext>(opt => opt.UseSqlServer(Configuration["Data:DefaultConnection:ConnectionString"]));
// Add Identity services to the services container.
services.AddIdentity<ApplicationUser, ApplicationRole>(options =>
{
options.Cookies.ApplicationCookieAuthenticationScheme = "ApplicationCookie";
options.Cookies.ApplicationCookie.AuthenticationScheme = "ApplicationCookie";
options.Cookies.ApplicationCookie.CookieName = "oAuthInterop";
options.Cookies.ApplicationCookie.AutomaticChallenge = true;
options.Cookies.ApplicationCookie.AutomaticAuthenticate = true;
options.Cookies.ApplicationCookie.DataProtectionProvider = new DataProtectionProvider(new DirectoryInfo("d:\\development\\artefacts"),
configure =>
{
configure.SetApplicationName("TestAuthApp");
//configure.ProtectKeysWithCertificate("thumbprint");
});
})
.AddEntityFrameworkStores<OAuthAppDbContext, int>()
.AddDefaultTokenProviders();
und ich brauche das Entity Framework Vertrauen (und rief meine eigenen db Methoden zum Sammeln von Benutzerdaten) zu entfernen. Hat jemand sonst etwas Ähnliches in ASP.net Core gemacht?
Vielen Dank im Voraus für alle Zeiger! :-)
Nur neugierig, haben Sie ohne ef implementiert? wenn Sie irgendein Beispiel haben, können Sie es bitte bekannt geben. Danke – Swamy