Can you connect using an SQL user id and password?
No, I was asked to connect by windows authenication only. The page runs on IIS, but guest users and NT authenications are both enabled.
I asked for you to connect by SQL ID and password for troubleshooting purposes only. A first step if you will, as there are many things which could be the problem and that helps to eliminate some of those.
The message from the debugger is:
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
... I i know this message is telling me - disable guest user and it will work, but im needing to be able connect just by using JUST windows authenication?
In IIS you must disable the anonymous login and enable ONLY Integrated Windows Authentication for the
site. If you fail to disable the anonymous login the Windows credentials will not be used.
i know guest account is the problem, but we run 6 internal sites on this single server and we have the guest account enabled so allow our clients (who log into our system through citrix server) to view them.
If anonymous logins are enabled the SQL server will not see DOMAIN\Guest as the user...it will see IUSR\machinename as the user, which is not a global (domain) account. It is less than guest, it is anonymous.
In IIS you can assign a DOMAIN account to be used for anonymous logins other than IUSR\Machine name.
So in your case, (with the CITRIX clients) you can assign the anonymous user for the web application to a NEW domain account called DOM\applicationName.
Then give the DOM\applicationName user basic access to the SQL server tables necessary for the application.
but our 7th site is our intranet and our companies IT manager in the UK has decided to make life hard for me and want a "personel" page where users can view/update their details such as address etc stored AD
querying AD is fine - i can do this no problem - its knowing which user on our network is viewing the webpage is the problem.
Then you are back to disabling the anonymous user in IIS.
It has been a while, but it seemed to me that my banking applications that allowed remote access via Citrix, still required the remote user to log in using a NT Authority user ID and Password which was passed on the the internal apps, since in effect they were logging into the local NT authority.
I have previously got it working by java applets and using a signed JAR file, but our IT manager dislikes using signed JAR file as it requires user to accept/trust this certificate to use the JAR across our network and has suggested using MS SQL's SYSTEM_USER command to return the username of the user viewing the page, but before we can execute this command/stored procedure in MS SQL, i have to try connect to MS SQL by using windows authenicaton first.
yor probably saying - IT manager is a ***** - why not just use the working solution? well, i dont know why!
No actually I tend to agree with the manager's thought process and do not understand why you have the anonymous user enabled for this type of application.
then you'll ask why only connect by windows auth, well - the reason is if i connect using a servername, username and password like "FILE04ABZPI", "SD" & "12345" the MS SQL command SYSTEM_USER returns "SD" each time as it is the username we connect with...
Exactly, which is why in this case you need SSPI. That I don't like SSPI does not imply I have never used it or that it does not have a place.
so the millon doller question is can it be done?
It is an all or nothing proposition as far as I know. If you want to pass the NT user to SQL you need to disable the anonymous user for the
site.