Asp.net mvc 在Asp.Net Identity中为自定义UserManager设置Owin
我正在使用neo4j.AspNet.Identity对我的网站进行身份验证,我有以下类连接到数据库,名称为GraphClientWrapper和Neo4jUserManager。GraphClientWrapper类为:Asp.net mvc 在Asp.Net Identity中为自定义UserManager设置Owin,asp.net-mvc,asp.net-web-api,neo4j,owin,asp.net-identity-2,Asp.net Mvc,Asp.net Web Api,Neo4j,Owin,Asp.net Identity 2,我正在使用neo4j.AspNet.Identity对我的网站进行身份验证,我有以下类连接到数据库,名称为GraphClientWrapper和Neo4jUserManager。GraphClientWrapper类为: using System; using Neo4jClient; /// <summary>A wrapper class to allow the GraphClient to be used within the OWIN framework (must i
using System;
using Neo4jClient;
/// <summary>A wrapper class to allow the GraphClient to be used within the OWIN framework (must implement <see cref="IDisposable"/>)</summary>
public class GraphClientWrapper : IDisposable
{
public GraphClientWrapper(IGraphClient graphClient)
{
GraphClient = graphClient;
}
public IGraphClient GraphClient { get; set; }
public void Dispose()
{
}
}
但是要连接到数据库,我应该遵循以下代码
var gc = new GraphClient(new Uri("http://localhost.:7474/db/data"));
gc.Connect();
var graphClientWrapper = new GraphClientWrapper(gc);
var manager = new Neo4jUserManager(new Neo4jUserStore<ApplicationUser>(graphClientWrapper.GraphClient));
问题是我不知道如何设置owin来使用我的自定义UserManager。有人能帮忙设置owin吗
var gc = new GraphClient(new Uri("http://localhost.:7474/db/data"));
gc.Connect();
var graphClientWrapper = new GraphClientWrapper(gc);
var manager = new Neo4jUserManager(new Neo4jUserStore<ApplicationUser>(graphClientWrapper.GraphClient));