SSPI handshake failed with error code 0x8009030c while establishing a connection with integrated security

sql-server, sql-server-2005

Solution

The key to this issue, for me at least, is the fact that the connection to SQL Server is being made over the loopback interface (127.0.0.1). I had the same symptoms, and found the answer in this blog post.

To summarise: there is a loopback check taking place which causes trusted connections via the loopback adapter to fail. This check can be removed by adding a registry entry as follows:

- Edit the registry using regedit. (start –> run … Regedit )

- Browse to : HKLM\System\CurrentControlSet\Control\LSA

- Add a DWORD value called “DisableLoopbackCheck”

- Set this value to 1

I rebooted after making this change, just to be sure, but you may find that this is not necessary. After this registry change was effected, I could make trusted connections via the loopback adapter.

Kudos to the Blackhawk Consulting Blog for pointing me in the right direction on this issue.

Problem

I get the following error while trying to connect to SQL Server 2005 using JDBC connection. ``` Error: 17806, Severity: 20, State: 2. Logon SSPI handshake failed with error code 0x8009030c while establishing a connection with integrated security; the connection has been closed. [CLIENT: 127.0.0.1] Logon Error: 18452, Severity: 14, State: 1. Logon Login failed for user ''. The user is not associated with a trusted SQL Server connection. [CLIENT: 127.0.0.1] ``` MY connection URL: ``` jdbc:sqlserver://LOCALHOST:1433;DatabaseName=master;integratedSecurity=true ```

Original source