First: My problem is not the same as yours, but this post is the first thing that appears on google for the Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON' error at the time I wrote it. The solution can be useful for people who are looking for this error, because I did not find this specific solution anywhere on the Internet.
In my case, I used Xampp / Apache and PHP sqlsrv to try to connect to the MSSQL database using Windows authentication and received the Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON' error you described. Finally, I found that the problem is that the Apache service itself is running under the user "LOCAL SERVICE" instead of the user account I was registered with. In other words, he literally used an anonymous account. The solution was to go to services.msc, right-click the Apache service, go to "Properties", go to the "Login" tab and enter the credentials for the user. This is consistent with your SPN issue, as your SPN is configured to work from a specific user in the domain. Therefore, if the correct SPN is not running, Windows Authentication will default to the wrong user (probably the "LOCAL SERVICE" user) and give you an anonymous error.
Here, where it differs from your problem. None of the computers on the local network are in the domain, they are only in the workgroup. To use Windows authentication with a workgroup, both a computer with a server (in my case, MSSQL Server) and a computer with service request data (in my case, Apache), you must have a user with the same name and identical password.
To summarize, the Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON' error in both of our cases is apparently caused by the service not running and / or not for the right user. Ensuring the correct SPN or other service is in progress and the anonymous part of the problem should be resolved under the correct user.
Caboosetp Jul 10 '15 at 15:01 2015-07-10 15:01
source share