4

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?

Phil Haselden
  • 2,876
  • 3
  • 30
  • 25

1 Answers1

2

Authenticate with AD using DirectoryService Class. The following link will help to achieve this.

Active Directory With C#

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

  • 1
    This seems to be the only/best option, though I am somewhat surprised that ASP.Net Identity doesn't have support built in. – Phil Haselden Oct 12 '15 at 02:55