0

The code below works fine when running from a Console C# application: System.Security.Principal.WindowsIdentity wi = new System.Security.Principal.WindowsIdentity("User001");

but when I try to add it into a class inside my web application I get: {There are currently no logon servers available to service the logon request}

at System.Security.Principal.WindowsIdentity.KerbS4ULogon(String upn) at System.Security.Principal.WindowsIdentity..ctor(String sUserPrincipalName, String type) at System.Security.Principal.WindowsIdentity..ctor(String sUserPrincipalName) ...

I am assuming this is related to Kerberos and since Web Applications run under an Application Pool I wonder if I need to register a SPN or do something extra here to get this to work(for the local Account).

The console app runs under my DOMAIN\USER001 and the Web app (App Pool) runs under MY_LOCAL_MACHINE\USER001

so I am trying to verify if I need to run SetSPN.exe or not and what is the command line.

Thank you

Max
  • 1,289
  • 3
  • 26
  • 50

1 Answers1

0

I had the same issue in my 2008R2 VM running SP2010 with a backend WCF service. In the service I was calling

WindowsIdentity id = new WindowsIdentity("MyApplicationUser");

You need to make sure your NetLogon service is running. If you are running a VM, you will need to configure the DNS role in order for this service to start. Once I did this, my code worked.

Gx3r0
  • 11
  • 1