MS SQL via Windows Authentication

Any tips on how to create a datasource that connects to MS SQL Server 2008
with windows authentication? I can connect via SQL authentication, but not
with windows. With windows, I get “Login failed for user ”. I
have tried both the Microsoft and jTDS drivers.

Thanks!

Hi,

The Windows user that would be connecting to your database, is the user Tomcat runs under. (see the User Name column in task manager, or the Service details)
It will probably be Network Service or Local Service. You can change that user in the Services window > detail page of the Tomcat/Lucee service > Log on, to match a valid Windows user for your MSSQL database. This user also must have the privileges to run Tomcat / access the web files, but shouldn’t be able to take over your server.

Then, use the JTDS driver, enter all database details, except the username+password (leave them empty).
Save it, test it.

If you get an SSO error (“native sspi service blabla”), follow this advice: java - I/O Error: SSO Failed: Native SSPI library not loaded - Stack Overflow http://stackoverflow.com/questions/13267764/i-o-error-sso-failed-native-sspi-library-not-loaded
Don’t forget to restart Lucee after you added the dll, if it was necessary.

Kind regards,

Paul KlinkenbergOp 8 sep. 2015, om 23:31 heeft Strom <@Strom> het volgende geschreven:

Any tips on how to create a datasource that connects to MS SQL Server 2008 with windows authentication? I can connect via SQL authentication, but not with windows. With windows, I get “Login failed for user ”. I have tried both the Microsoft and jTDS drivers.

Thanks!


See Lucee at CFCamp Oct 22 & 23 2015 @ Munich Airport, Germany - Get your ticket NOW - http://www.cfcamp.org/ http://www.cfcamp.org/

You received this message because you are subscribed to the Google Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com mailto:lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com mailto:lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/9d1057fa-28d2-4763-b3fb-cbba1bc0decf%40googlegroups.com https://groups.google.com/d/msgid/lucee/9d1057fa-28d2-4763-b3fb-cbba1bc0decf%40googlegroups.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout https://groups.google.com/d/optout.

Thanks Paul! That solved it. If others have this problem, make sure the
ntlm.dll is in the ‘java.library.path’.On Wednesday, September 9, 2015 at 1:15:28 AM UTC-7, Paul Klinkenberg wrote:

Hi,

The Windows user that would be connecting to your database, is the user
Tomcat runs under. (see the User Name column in task manager, or the
Service details)
It will probably be Network Service or Local Service. You can change that
user in the Services window > detail page of the Tomcat/Lucee service > Log
on, to match a valid Windows user for your MSSQL database. This user also
must have the privileges to run Tomcat / access the web files, but
shouldn’t be able to take over your server.

Then, use the JTDS driver, enter all database details, except the
username+password (leave them empty).
Save it, test it.

If you get an SSO error (“native sspi service blabla”), follow this
advice:
java - I/O Error: SSO Failed: Native SSPI library not loaded - Stack Overflow
Don’t forget to restart Lucee after you added the dll, if it was necessary.

Kind regards,

Paul Klinkenberg

Op 8 sep. 2015, om 23:31 heeft Strom <kill...@gmail.com <javascript:>> het volgende geschreven:

Any tips on how to create a datasource that connects to MS SQL Server 2008
with windows authentication? I can connect via SQL authentication, but not
with windows. With windows, I get “Login failed for user ”. I
have tried both the Microsoft and jTDS drivers.

Thanks!


See Lucee at CFCamp Oct 22 & 23 2015 @ Munich Airport, Germany - Get your
ticket NOW - http://www.cfcamp.org/

You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+un...@googlegroups.com <javascript:>.
To post to this group, send email to lu...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/9d1057fa-28d2-4763-b3fb-cbba1bc0decf%40googlegroups.com
https://groups.google.com/d/msgid/lucee/9d1057fa-28d2-4763-b3fb-cbba1bc0decf%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.