The Goal
Login using Active Directory Authentication with IIS 7.x using .NET 4.0 and the Intregrated Pipeline.
The Problem
Documentation dictates that you can't use IIS7 with Integrated Pipeline and you must switch to a Classic Application pool. If you try you will get redirect loops and constant user switching between login and logout states.
Step 1
Add the Active Directory Authentication Module to the System.WebServer module section of the web.config
<add name="Authentication" type="DotNetNuke.Authentication.ActiveDirectory.HttpModules.AuthenticationModule, DotNetNuke.Authentication.ActiveDirectory" preCondition="managedHandler" />
Step 2
The code just needed modified in the AuthenticationModule.vb handler
- Removed checks for if the server is using IIS7. Line: 84-86
- Removed the check for Hosting Permission Leveling (Although I'm sure this could be put back). Line: 87-90
- Changed the Response.Redirect on the AuthStatus=AuthenticationStatus.Undefined If statement to a HttpContext.Current.Server.Transfer(url) . Line: 121
The Server.Transfer stops the authentication module from getting stuck in a redirect loop where the cookie is not read properly when obtaining the current status of the login process.
My Configuration
Now with these tweaks enabled you simply need to follow the standard installation guide to enable Windows Authentication security and configure your site as a trusted site.
What you can now do with this module fully functioning.
- Login automatically with active directory authentication
- Log out (3 minutes logout duration before you are automatically logged in again.)
- Login as a standard DNN user. aka Host User
You are now 1 step closer to single sign-on bliss.