How to configure IAG KCD in Load Balancing Architectures (IIS 6.0 / 7.0) Created by forefrontsupport on 10/13/2010 9:39:10 PM Before you begin
So what is the problem with Kerberos Constrained Delegation (KCD) in Load Balancing Architectures? and how we are going to solve it?
When ISA/IAG request Kerberos ticket on behalf of the client and present it to the back-end web server, it must be configure to trust for delegation to the back-end server for a specific service, and this server must have UNIQUE SPN (Service Principle Name) related to a unique service so the KDC (Kerberos Distribution Center) will be able to issue Kerberos ticket and send it to the ISA/IAG server.
When there is ONE virtual hostname for two web servers (Load Balancing Scenarios) you cannot assign the same SPN for two web servers! (You must have UNIQUE SPN)
Please read this article to learn how to solve this issue in both IIS 6.0 and IIS 7.0 architectures
Important to know!
- I will cover the Active Directory and the Web Servers configurations sides and in high level the IAG configuration side
- In the IIS 7.0 configurations section I'm using TSWeb 2008 architecture
- In the IIS 6.0 configurations section I'm using my own web program that I developed which display the identity of the original client that perform that authentication (the original client)
Prerequisites
- I assumed that you have already Installed IAG, configure Trunk and Application using KCD
- I recommend you to Install ADSIEDIT on the Active Directory machine
Configuration Procedures
Conceptual high level architecture
The following diagram maps the relevant attributes which demonstrate the solution for the KCD Load Balancing problem: SPN, msDS-AllowToDelegateTo

Flow Diagram – ISA / IAG KCD (with Smart Card) in Load Balancing Architecture

Active Directory Configuration Procedures
- Create Service Account in the Active Directory (choose strong password)
- I called my service account svcIIS
This account need to be only a "Domain users" member

Add the SPN "http/nlbiis.lab.iagserver.org" to the Service Account svcIIS.I prefer using ADSIEDIT but if you are not familiar with this tool please download setspn.exe and use it with the following syntax:
setspn -A http/nlbiis.lab.iagserver.org LAB\svcIIS

Configure the IAG Computer Account for Trusted for Delegation in the Active Directory to the svcIIS Service Account and choose the SPN "http/nlbiis.lab.iagserver.org"

Configure the svcIIS Service Account for Trusted for Delegation in the Active Directory to the WEB01.lab.iagserver.org, choose the SPN "http/WEB01.lab.iagserver.org" and also to the WEB02.lab.iagserver.org, choose the SPN "http/WEB02.lab.iagserver.org".
Use ADSIEDIT, go to the svcIIS account and find the attribute "msDS-AllowedToDelegateTo" and add the following SPN's according to the following print screen

IIS 6.0 Configuration Procedures
Add the account to the local group "IIS_WPG" on the IIS server, this group have the following user rights: "Impersonate a client after authentication"

- Open the IIS Manager on the back-end IIS server (Start->Run->inetmgr.msc)
- Navigate to the Application Pools
- Right click on the relevant Application Pool
- Navigate to the "Identity" Tab
- Change the identity of the Application Pool to the Service Account we created (svcIIS)
Choose "OK"

Navigate to the relevant Site/Virtual Directory, Right click -> Properties -> Directory Security -> Authentication and access control-> Edit. Make sure you are using Internet Windows Authentication (IWA)

This is not relevant to KCD and Load Balancing, but If you want IIS to impersonate the user and forward it to the application (my code below), you need to configure in the web.config

The following print screen illustrate my test page that I wrote, I used the WindowsIdentity class and the GetCurrent method to print the original authenticated clien

This is the code I wrote, you can use it to be sure that the IAG forward the original user credentials

IIS 7.0 Configuration Procedures
- Create service account in the Active Directory (choose strong password)
- I called my service account svcIIS
This account need to be only a "Domain users" member

- Open the IIS Manager on the back-end IIS server (Start->Run->inetmgr.msc)
- Navigate to the Application Pools
Right Click on the relevant Application Pool and choose "Advanced Settings"

Change the identity of the Application Pool to the Service Account we created (svcIIS)

- And click OK
Verify the Application Pool Identity after you change it

Navigate to the relevant Site/Virtual Directory, choose the "Authentication" icon.

Make sure ONLY "Windows Authentication" is Enabled

Navigate to C:\Windows\System32\inetsrv\config and open the file "application.config"

Add the following useAppPoolCredentials="true" (this is for TSWeb scenario)

Verify in the IIS logs that you see the original user


IAG (High Level) Configuration Procedures
Important !!! on the IAG server you must configure the following FQDN "NLBIIS.IAGserver.ORG" on the "Web Servers" tab

Important !!! on the IAG server you must configure the following FQDN "NLBIIS.IAGserver.ORG" on the "Portal Link" tab

Before IAG SP2 you need to configure the SPN in the ISA server rules, in the "Authentication Delegation" tab. Important !!! you must configure the identical SPN "http/NLBIIS.IAGserver.ORG" to the FQDN

In IAG SP2 you need to configure the SPN in the IAG "Web Settings" tab. Important !!! you must configure the identical SPN "http/NLBIIS.IAGserver.ORG" to the FQDN

If you have any issues with this configuration please post them in our Technical Forums in the following link: http://Forums.ForefrontSecurity.ORG
