简体   繁体   English

将 OpenID Connect 用户映射到 ASP.NET Core 身份用户

[英]Map OpenID Connect User to ASP.NET Core Identity User

I am looking at adding OpenID Connect support to an existing ASP.NET Core application which uses ASP.NET Core Identity and a local SQL database of users.我正在考虑将 OpenID Connect 支持添加到使用 ASP.NET Core Identity 和本地 SQL 用户数据库的现有 ASP.NET Core 应用程序。 These users have profiles within the application and have multiple database tables linked to them, such as events and items that they created.这些用户在应用程序中有配置文件,并且有多个链接到他们的数据库表,例如他们创建的事件和项目。

My question is, is there a recommended way to ensure that when the user authenticates via Azure AD using OpenID Connect, they become associated in some way to the existing user that is in the AspNetUsers database table?我的问题是,是否有推荐的方法来确保当用户使用 OpenID Connect 通过 Azure AD 进行身份验证时,他们会以某种方式与 AspNetUsers 数据库表中的现有用户相关联?

See this article Persist additional claims and tokens from external providers in ASP.NET Core .请参阅这篇文章Persist additional claim and tokens from external providers in ASP.NET Core It describes how you can lookup and map local user claims with the external user.它描述了如何使用外部用户查找和映射本地用户声明。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM