Search code examples
active-directoryasp.net-mvc-4wifclaims-based-identityadfs2.0

How to use ADFS 2.0 with asp mvc 4


I am writing a MVC 4 web app and want to use the new WIF and ADFS to Authenticate users. I also want to provide a profile page for users to "self serve" changes like phone number or maiden name.

I am looking for resources/tutorials (a good book) to show me how to wire it all up.

Users will be stored in active directory so I'm guessing that I should use the ADMembershipProvider for some of this. I believe there is a profile store attached to ADFS (or I can set one up) and I want to know if its good practice to interact with it directly or is the an API that with let me add claims etc.

Finally, how does all this fit into the new WebSecurity stuff?


Solution

  • In terms of the ADMembershipProvider, you don't need it.

    ADFS under the hood handles the AD integration, You configure claims rules which determine which attributes ADFS extracts out of AD.

    Update

    In terms of editing the user in AD, this is an Identity Manager scenario. ADFS is a STS so it doesn't handle this. You need to do this directly e.g. Howto: (Almost) Everything In Active Directory via C#. Be aware that you need an AD login that enables write access to do this. This is a different credential set to the set that allows you to login to ADFS.

    ADFS just provides the login screen. Out the box you don't get any self-service functionality. You need to customise the ADFS screen yourself e.g. AD FS 2.0 Sign-In Pages Customization Overview.