I've been struggling with this for a while now. One of the troubles is, I'm not admin on any of the servers (IIS, SQL, or AD).
I'm writing a web/db app that needs to use windows authentication to connect to a sql server. The domain controller, web server, and sql server are three different machines. Currently, I have NT permissions set to prompt a user for a login/pass (NTLM, not basic). I would like to use those credentials to attach to the sql server. I've had no luck.
SQL server is set to Mixed Mode. IIS server is set to NTLM login.
I've used various connection strings in ASP, but again, no luck. I can connect to the DB using Enterprise Manager authenticating with my domain login (so, I'm a valid db user).
Some connection strings I've used:
1.
conn.open "Provider=SQLOLEDB.1;UID=m
ydomain/my
username;P
assword=my
password;P
ersist Security Info=True;Initial Catalog="&tablename&";Data
Source="&servername
((here, i've hardcoded in my login/pass (which I don't want to do) and error: "Login failed for user mydomain/myusername"))
2.
conn.open "Provider=SQLOLEDB.1;Integ
rated Security=SSPI;Persist Security Info=True;Initial Catalog="&tablename&";Data
Source="&servername
((here, i've used "integrated security" but error: "Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'"))
I've used plenty of other combinations of switches and options but to no avail. However, I created a "Standard" sql login and used it's username/password to connect (via #1, above) it worked just fine.
Bottom line. I am using NTLM to authenticate to my web app. I can connect to my DB using a sql account. I want to connect to my DB using NTLM authentication. The three services (IIS, SQL, AD) are on three different servers. Any help?
Start Free Trial