简体   繁体   English

获取IdentityServer3以使用现有用户sql数据库

[英]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.

相关问题 IdentityServer3通过请求后的用户名和密码获取用户令牌 - IdentityServer3 get user token by username and password post REQUEST 如何在IdentityServer3中使用Ajax注销用户 - How To logout user with ajax in identityserver3 IdentityServer3-如何在PreAuthenticateAsync中获得部分身份? - IdentityServer3 - how to get partial identity in PreAuthenticateAsync? Asp.Net Identity 2 用户信息如何映射到 IdentityServer3 配置文件声明 - How does Asp.Net Identity 2 User Info get mapped to IdentityServer3 profile claims 用户登录时,IdentityServer3需要角色(作为附加凭据) - IdentityServer3 requiring a role when the user logs in (as additional credential) IdentityServer3如何使用signin =从MVC客户端应用程序重定向用户 - IdentityServer3 How to redirect user from MVC Client application with signin= IdentityServer3 + Active Directory +自托管用户数据库 - IdentityServer3 + Active Directory + Self-Hosted User db 注册IdentityServer3后自动登录本地用户 - Automatically login local user after registration with IdentityServer3 具有IdentityServer3 AccessTokenValidation的Identityserver4 - Identityserver4 with IdentityServer3 AccessTokenValidation 如何在Azure B2c中使用IdentityServer3或4作为自定义策略 - How to use IdentityServer3 or 4 in Azure B2c as custom policy
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM