sql-serveriiskerberoskerberos-delegationspn

Kerberos authentication issue : Site stops working automatically after some time


There is a website set to run on windows authentication. There are 3 web applications under the site, each on their own application pool, but with the same domain account. ASP.NET impersonation, Use App Pool credentials, Use Kernel mode authentication are set to true.

  1. SPN for the website DNS url is in place for the app pool account.
  2. SPN for the SQL service is in place.
  3. App pool account is set to delegate to the SQL service account.

With the above settings in place, the three applications work fine for sometime. Then automatically they stop connecting to the DB with the error "Login failed for user NT Authority\Anonymous Logon".

After resetting IIS, the 3 applications stay up for sometime, then they again stop connecting to DB, one application after another. Weird?

What could be the issue? Any pointers?


Solution

  • Short Answer:

    1. Create separate websites and app pools.
    2. Create 3 SPNs for three websites.
    3. Create 3 SPNs for three Databases.

    Long answer:

    After the above are done, there are no more issues ! Hurray !