[英]How do I go about adding IdentityServer3 to an existing ASP.Net Identity based project?
I'm looking to add IdentityServer3 to a web app that currently uses a standard Entity Framework, SQL Server, Code First based approach to managing users and roles. 我希望将IdentityServer3添加到当前使用标准实体框架,SQL Server,基于代码优先的方法来管理用户和角色的Web应用程序中。
I would like to add IdentityServer3 for securing a new Web API endpoint with Basic Auth, JWT and OAuth2. 我想添加IdentityServer3以使用Basic Auth,JWT和OAuth2保护新的Web API端点。 They key point would be to leave the existing user experience (login urls, cookies etc) undisturbed.
他们的关键点是保持现有的用户体验(登录网址,cookie等)不受干扰。
I'd like to leave the ASP.Net identity code alone as much as possible. 我想尽可能地单独留下ASP.Net身份代码。
My question is, what are the key steps I need to perform and are there are relevant samples? 我的问题是,我需要执行哪些关键步骤,是否有相关样本?
There seems to be plenty of documentation but it's fairly involved and I can't find a sample for this exact scenario. 似乎有大量的文档,但它相当复杂,我找不到这个确切场景的样本。
Besides the usual Identity Server setup, if you have an existing ASP.NET Identity code base that you would like it to use, you will need to implement the UserService feature of Identity Server. 除了通常的Identity Server设置之外,如果您希望使用现有的ASP.NET Identity代码库,则需要实现Identity Server的UserService功能。 This service allows Identity Server to use your user store to authenticate users.
此服务允许Identity Server使用您的用户存储来验证用户。
You can find a provided ASP.NET Identity User Service here for inspiration. 您可以在此处找到提供的ASP.NET身份用户服务以获取灵感。 This includes a sample host in the source.
这包括源中的示例主机。
For getting started with Identity Server this walkthrough in the official documentation would be the best place for you to start . 对于Identity Server的入门,官方文档中的这个演练将是您开始的最佳位置。
I also have a couple of articles for getting started with Identity Server and about the default ASP.NET Identity User Service that you may find useful after having a look at the official documentation. 我还有几篇关于开始使用Identity Server的文章,以及在查看官方文档后可能会发现有用的默认ASP.NET身份用户服务 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.