I'm implementing corporate website with asp.net mvc and want to use new ASP.NET Identity framework. Is it possible to integrate ActiveDirectory authorization with ASP.NET Identity? Any samples how to do it?
Asked
Active
Viewed 2.5k times
31
-
Yes, it's possible to marry Active Directory with Identity. Check out this answer for a complete example: https://stackoverflow.com/a/74734478/8644294 – Ash K Dec 08 '22 at 18:01
1 Answers
15
Yes it's possible using a claim based authentication. It's integrated to .Net 4.5 now (before it was called WIF).
You can use Thinktucture, which is a very robust authentication provider it has a full example on how to integrate ADFS. Here is a link for it.
Here is another way to do it for an MVC4 app - MVC 4 and ADFS integration guide included
Here's a solution for MVC5 Web app using ADFS On-Premises Organizational Auth and Visual Studio 2013 localhost development
If you don't want to use ADFS you can use the
ActiveDirectoryMembershipProvider
. It works with Windows authentication and here's an post of using it with Forms authentication - Chris Schiffhauer - Implement Active Directory Authentication in ASP.NET MVC 5:

KyleMit
- 30,350
- 66
- 462
- 664

Oualid KTATA
- 1,116
- 10
- 20
-
2
-
-
2I use ActiveDirectoryMembershipProvider it based on old asp.net membershipment. I want to switch to ASP.NET Identity – barbarian Aug 21 '14 at 14:32
-
http://www.asp.net/visual-studio/overview/2013/creating-web-projects-in-visual-studio#orgauth – Oualid KTATA Aug 21 '14 at 15:33
-
-
2Not to toot my own horn, but I wrote a blog post on this: https://willwebforfood.wordpress.com/2015/04/01/owin-and-active-directory/ – Michael Dunlap Apr 03 '15 at 19:39
-
1However I think "ActiveDirectoryMembershipProvider" is the old way. Here is a guide how to implement a custom ASP.NET identity without EF. Probably you have to do the same for Active Directory, but it seems to be quite a lot of work for such a standard functionality, that should actually be integrated in ASP.NET: http://www.asp.net/identity/overview/extensibility/overview-of-custom-storage-providers-for-aspnet-identity#rolestore – Niklas Peter Aug 07 '15 at 07:53