[英]Get IdentityServer3 to use existing user sql database
I am trying to authenticate a user against an existing user database. 我正在尝试针对现有用户数据库对用户进行身份验证。 I have an existing database with a users table and I want the Identity Server to look at this database and get authenticate the user.
我有一个带有用户表的现有数据库,我希望Identity Server查看此数据库并对用户进行身份验证。
I have found examples for MembershipReboot and AspNetIdenetity, but I am confused on how I need to create my own user database mapping. 我找到了MembershipReboot和AspNetIdenetity的示例,但我对如何创建自己的用户数据库映射感到困惑。
I am not trying to create an external provider eg Facebook 我不是要创建一个外部提供商,例如Facebook
Has anyone got any ideas or seen any tutorials on how this can be done? 有没有人有任何想法或看到任何关于如何做到这一点的教程?
You can implement your own IUserService, then in your startup you can set IdentityServer to use your new User Service 您可以实现自己的IUserService,然后在启动时可以将IdentityServer设置为使用新的用户服务
var factory = InMemoryFactory.Create(
clients: Clients.Get(),
scopes: Scopes.Get());
var userService = new MyUserService();
factory.UserService = new Registration<IUserService>(resolver => userService);
https://identityserver.github.io/Documentation/docsv2/advanced/userService.html https://identityserver.github.io/Documentation/docsv2/advanced/userService.html
EDIT: Fixed dead link 编辑:修复死链接
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.