Josh Wright
Josh Wright

Reputation: 576

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. 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?

Upvotes: 5

Views: 1983

Answers (1)

Tore Nestenius
Tore Nestenius

Reputation: 19921

See this article Persist additional claims and tokens from external providers in ASP.NET Core. It describes how you can lookup and map local user claims with the external user.

Upvotes: 3

Related Questions