Also aktualisiere ich einen Open Source asp.net Identity-Provider für MongoDB mit Asp.Net Identity 3.0 (aka vnext) zu arbeiten. Bisher hat ich in der Lage, den Anbieter registrieren und Benutzer erstellen, aber bei der Verwendung der SignInManager wenn ein korrekter Benutzername/Pass vorgesehen, erhalte ich die FehlerWie sind die Namen der Authentifizierung in asp.net vnext registriert
InvalidOperationException: Die folgenden Authentifizierungstypen waren nicht akzeptiert: Microsoft.AspNet .Identity.Application
ich habe den Fehler https://github.com/aspnet/HttpAbstractions/blob/dev/src/Microsoft.AspNet.PipelineCore/DefaultHttpResponse.cs
hier aufgespürt, aber ich kann nicht zu sehen scheinen, wo der SignInContext.Accepted Namen dem SignInContext hinzugefügt wird, bekommen.
Ich bin mit den Alpha-2-Versionen aller der vNext Bibliotheken, die
Unten in VS14 CTP2 verwendet werden, um meinen ist Startup.cs
public void Configure(IBuilder app)
{
try {
// For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940
var configuration = new Configuration();
configuration.AddJsonFile("config.json");
configuration.AddEnvironmentVariables();
// app.UseLogRequests("try");
app.UseErrorPage(ErrorPageOptions.ShowAll);
app.UseServices(services =>
{
services.AddIdentity<MyUser>()
.AddMongoDB<MyUser>(configuration.Get("Data:MongoIdentity:ConnectionString"), configuration.Get("Data:MongoIdentity:DBName"))
.AddHttpSignIn<MyUser>();
// Add MVC services to the services container
services.AddMvc();
});
// Add static files to the request pipeline
app.UseStaticFiles();
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller}/{action}/{id?}",
defaults: new { controller = "Home", action = "Index" });
routes.MapRoute(
name: "api",
template: "api/{controller}/{action}",
defaults: new { action = "Index" });
});
// Add cookie-based authentication to the request pipeline
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login"),
});
}
catch (Exception ex)
{
Console.Write(ex.ToString());
throw;
}
}
Ich wäre wirklich interessiert an dem Code/Paket, die es ermöglicht, MongoDB mit Identität unter vNext zu verwenden. Kannst du es bitte teilen? –
Also ist es immer noch ziemlich roh und implementiert noch nicht alle Features, ist aber brauchbar. Ich werde versuchen, es auf Github zu werfen, wenn ich in den nächsten Tagen eine Chance bekomme. –
Mittlerweile habe ich auch meine Lösung implementiert. –