Blog Post

IIS Support Blog
3 MIN READ

SPN configurations for Kerberos Authentication – A quick reference

Jawahar Ganesh S's avatar
Feb 04, 2019

Many people consider configuring Kerberos authentication and making it work as a daunting task. One of the reasons for this is different configuration elements involved in the process.

One such important configuration is setting the appropriate SPN.

 

There are three important elements that needs to be considered while setting the Kerberos SPN for our application. I have listed them below:

 

1.How users will browse the application?

                       Users can browse the application with machine name or with a custom domain name. In most of the cases browsing with machine name does not need an SPN registered. But there are few exceptions.

2.The application pool identity

3.How server is going to decrypt the Kerberos token forwarded by the client.

There are two important properties under

             system.webServer/security/authentication/windowsAuthentication

  • useAppPoolCredentials: When we have useAppPoolCredentials set to true, server will decrypt the Kerberos traffic using application pool identity.
  • useKernelMode: When we have useKernelMode set to true, server will decrypt the Kerberos traffic using machine account.

Even with good understanding of Kerberos workflow and above-mentioned elements, sometimes people get confused on what SPN to set.

 

I have included the below table, which can be a quick reference for the SPN’s needed for different combinations of host name and application pool identities.

 

URL

Use Kernel Mode

Use App pool Credentials

Application pool Identity

SPN requirement

Browsed with machine name

True

False

Machine account

No additional SPN’s are needed

HOST SPN will be sufficient

Browsed with machine name

True

False

Custom domain account

No additional SPN’s are needed

HOST SPN will be sufficient

Browsed with machine name

False

True

Machine account

No additional SPN’s are needed

HOST SPN will be sufficient

Browsed with machine name

False

True

Custom domain account

Setspn –a HTTP/<machine name> <custom account name>

Browsed with machine name

True

True

Machine account

No additional SPN’s are needed

HOST SPN will be sufficient

Browsed with machine name

True

True

Custom domain account

Setspn –a HTTP/<machine name> <custom account name>

Browsed with custom host name

True

False

Machine account

Setspn –a HTTP/<custom host name> <machine name>

Browsed with custom host name

True

False

Custom domain account

Setspn –a HTTP/<custom host name> <machine name>

Browsed with custom host name

False

True

Machine account

Setspn –a HTTP/<custom host name> <machine name>

Browsed with custom host name

False

True

Custom domain account

Setspn –a HTTP/<custom host name> <custom account name>

Browsed with custom host name

True

True

Machine account

Setspn –a HTTP/<custom host name> <machine name>

Browsed with custom host name

True

True

Custom domain account

Setspn –a HTTP/<custom host name> <custom account name>

Browsed with machine name

False

False

Machine account

No additional SPN’s are needed

HOST SPN will be sufficient

Browsed with machine name

False

False

Custom domain account

Setspn –a HTTP/<machine name> <custom account name>

Browsed with custom host name

False

False

Machine account

Setspn –a HTTP/<custom host name> <machine name>

Browsed with custom host name

False

False

Custom domain account

Setspn –a HTTP/<custom host name> <custom account name>

 

Hope this helps.

Updated Feb 04, 2019
Version 1.0

2 Comments

  • scarson116's avatar
    scarson116
    Copper Contributor

    "Computer Name Aliases" are a very useful tool for those "CNAME" scenarios.

    Using Computer Name Aliases in place of DNS CNAME Records - Microsoft Community Hub

    Here is the introduction:

    First published on TechNet on Jun 19, 2017
    Hi everyone. Graeme Bray here with an article around using Computer Name Aliases instead of DNS CName records.  In the past, we used to set the registry key DisableStrictNameChecking to be able to add a DNS alias to connect via a name (such as fileserver.contoso.com).  Starting with Windows Server 2008, we added functionality to be able to create a computer alias. What benefits does using computer aliases provide?

    • Automatic SPN management for Kerberos authentication.
    • No DNS access required
    • Automatic DNS entry updates for DNS A Records.
    • Eliminate the need and risk of editing the registry for "DisableStrictNameChecking" and "OptionalNames" keys

    What benefits does using a DNS CName provide?

    • Aliases pointing to a computer name, not an IP address

    To create a computer name alias, it's a very simple process. You need to run as an elevated Powershell (or command prompt) window. Enter the command as below, and you're done.

    Command: Netdom computername <COMPUTER> /add:<ALIAS>

    Example: Netdom computername IIS01 /add:webapp.surface.graemebray.com

    <Article continues>

  • Thanks Jawahar, this was a great reference.

    One important thing to note is that the hosts can have CNAMEs and most clients tend to use the SPN against the CNAME.