Reputation: 3006
I have an ASP.NET application that uses ASP.NET Identity 2.2. This was migrated from SQL Membership. In addition to using the AspNetUsers, AspNetRoles, etc tables the application also contains application-specific SQL Server tables which link back to Identity tables. For example, the SavedSearch table has a UserId column which contains values from AspNetUsers.Id.
Some customers now want the option to use their on-premises Active Directory (not Azure Active Directory or ADFS) for authentication. So the plan is to use Active Directory for authentication and Role membership etc will continue to be stored in SQL Server.
What is the best way to achieve this?
Upvotes: 4
Views: 2716
Reputation: 99
Authenticate with AD using DirectoryService Class. The following link will help to achieve this.
A common field such as email of user from Active Directory can be used to map with Membership related table for Handling the Role scanario. Email may not be available for some AD Users , you may ensure both sides (AD & Membership) has same email
Upvotes: 2