简体   繁体   English

如何将IdentityServer3添加到现有的基于ASP.Net Identity的项目中?

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

相关问题 Asp.Net Identity 2 用户信息如何映射到 IdentityServer3 配置文件声明 - How does Asp.Net Identity 2 User Info get mapped to IdentityServer3 profile claims IdentityServer3 的 ASP.NET Identity 插件 UI (IdentityManager) 在部署到 Azure (WebApp) 后不起作用 - ASP.NET Identity plugin UI (IdentityManager) for IdentityServer3 not working after deploying to Azure (WebApp) IdentityServer3中的回调,可访问当前的ASP.NET身份会话ID - Callback in IdentityServer3, with current ASP.NET Identity Session ID available to access IdentityServer4 和 ASP.Net Identity:添加额外声明 - IdentityServer4 and ASP.Net Identity: Adding additional claims ASP.Net MVC IdentityServer3破坏了我的webapi路由 - ASP.Net MVC IdentityServer3 broke my webapi routing 将 ASP.NET 角色授权与 IdentityServer3 隐式流结合使用 - Using ASP.NET Role Authorisation with IdentityServer3 implicit flow ASP.NET Core 3.1 MVC AddOpenIDConnect 与 IdentityServer3 - ASP.NET Core 3.1 MVC AddOpenIDConnect with IdentityServer3 IdentityServer4 与 ASP.NET 身份 - IdentityServer4 with ASP.NET Identity IdentityServer4 Asp.Net 核心身份 - IdentityServer4 Asp.Net Core Identity 将ASP.NET MVC5身份角色添加到我现有的Intranet项目中 - Adding ASP.NET MVC5 Identity Roles to my existing intranet project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM