Partager via


com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication.

On a Windows platform, when trying to connect to SQL Server using Integrated Authentication, you may see this exception:
    com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication.
along with the following trace message:
    com.microsoft.sqlserver.jdbc.AuthenticationJNI <clinit>
    WARNING: Failed to load the sqljdbc_auth.dll

This generally indicates that the driver can not find the appropriate sqljdbc_auth.dll in the JVM library path.  To correct the problem, please use the java.exe -D option to specify the "java.library.path" system property value.  You will want to specify the full path to the directory contain the sqljdbc_auth.dll.
    For example:  java -cp .;"c:\jdbcv1_2\sqljdbc.jar" -Djava.library.path="c:\jdbcv1_2\auth\x86" myApp

Alternatively, you can copy the sqljdbc_auth.dll to a directory in the search path (example: the local directory where you are executing your application).

Note: You may also get the same error message if the application is trying to use the incorrect architecture (x86 VS x64) version of the sqljdbc_auth.dll.  Try specifying the directory path to the other architecture.
If you are on a x64 machine running x64 OS, but the JVM you are using is the x86 version, you will need to specify and use the x86 version of the sqljdbc_auth.dll.

Some related information:
If you get the following exception:
  java.lang.UnsatisfiedLinkError: GetDNSName
This typically indicates that the application is trying to use the incorrect version (say v1.0 VS v1.1) of the sqljdbc_auth.dll.  Make sure the application is using the save version of the sqljdbc.jar and sqljdbc_auth.dll files.

Jimmy Wu, SQL Server
Disclaimer: This posting is provided "AS IS" with no warranties, and confers no rights

Comments

  • Anonymous
    July 26, 2007
    A question about this, if we have one server for SQL Server 2005 and another one for the WebServer, where must we specify the "java.library.path" system property value? On the webserver or on the SQL Server? Thank you! Adrien

  • Anonymous
    July 29, 2007
    The comment has been removed

  • Anonymous
    February 12, 2008
    I am trying to get Websphere 6.1 app server to connect to MSSQL Server 2005(via Hibernate) using Windows integrated Security/Authentication. >> My jdbc.proerties lokked like this ... jdbc.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver jdbc.url=jdbc:sqlserver://172.16.1.3;instanceName=ads;database=qa_vyasa_ads;integratedSecurity=true; >> I have placed the "sqljdbc.jar" in the application lib folder. >> My application would start but, would throw the following exception ...


[2/13/08 15:52:51:359 IST] 00000016 SystemOut     O 2008-02-13 15:52:51,312 WARN [org.hibernate.cfg.SettingsFactory] - <Could not obtain connection metadata> org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (This driver is not configured for integrated authentication.) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:855) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:76) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2006) . . . Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source) at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37) at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290) at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:877) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:851) ... 44 more

>> I had not added the path of the "sqljdbc_auth.dll" file into the java.library.path JVM start params. - SO I added the path into the systems "PATH" environment variable and now its part of the the "java.library.path" >> The above exception is gone.But websphere would not start, it starts and shuts down automatically. Please let me know if I am missing something in the Websphere 6.1 environment. ****** I followed the same steps with Tomcat 5.0 and integratedSecurity works like charm.The issue is only with Websphere 6.1 ****** Many thanks for your time. --Yash

  • Anonymous
    February 13, 2008
    The comment has been removed

  • Anonymous
    April 14, 2008
    The comment has been removed

  • Anonymous
    June 05, 2008
    I have a particular problem with this driver. In fact, i use three webapp in the same instance of Tomcat Server. The surprise is that i can use only one webapps, the others throw the exception : com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication.

  • Anonymous
    June 25, 2008
    The comment has been removed

  • Anonymous
    August 04, 2008
    I have the same error as Javed Samsoud. I ahve three application in tomcat and when I start, I can use only one application, the other two are not working and I have a warning ATTENTION: Failed to load the sqljdbc_auth.dll and in the exception the message This driver is not configured for integrated authentication. appears. Pls help! Jay

  • Anonymous
    August 05, 2008
    Have you tried the steps in the blog above ie putting the sqljdbc_auth.dll to the application directory or in the JVM library path?

  • Anonymous
    August 08, 2008
    Our application runs on both Windows and Linux, and we are getting the same warning about loading the sqljdbc_auth.dll on both platforms.  Installing the sqljdbc_auth.dll works great for Windows, but when we install the Linux driver we can't find an equivalent sqljdbc_auth for Linux.  Does one exist?   By the way, we tried using the sqljdbc_auth.dll in the Linux install thinking that it had the same name but was compiled for Linux, but it doesn't work.

  • Anonymous
    August 08, 2008
    There is no version of the integrated authentication dll that will work from Linux. Currently integrated authentication is Windows only.

  • Anonymous
    November 13, 2008
    jay & javed - problem may be that you have multiple sqljdbc.jar's each trying to classload sqljdbc_auth.dll, and the 2nd initialization fails. look at your installation - if you have multiple sqljdbc.jar files, combine them into a single place and see if that solves your problem.

  • Anonymous
    March 08, 2009
    The comment has been removed

  • Anonymous
    March 11, 2009
    The comment has been removed

  • Anonymous
    April 10, 2009
    First, thank you for the fix. It works only when I'm running it in a class as a Java Application. But when I use the same class in a servlet, I get com.microsoft.sqlserver.jdbc.AuthenticationJNI <clinit>    WARNING: Failed to load the sqljdbc_auth.dll I have placed the sqljdbc_auth.dll file in the main project dir, which did work on a regular class but not when used with a servlet.

  • Anonymous
    April 14, 2009
    I would look at how to setup the class path for your particular application server. The application servers class path may be different from your standard java vm path.

  • Anonymous
    April 27, 2009
    Could someone give an example of what the connection string should look like? I notice a post above has "integratedSecurity" in the string, but it looks like it is cut off. I am setting this up in java withouth any assitance, so a more complete example would be helpful.

  • Anonymous
    April 27, 2009
    Hey jagooch, Does this work for you? Please notice that I'm assuming you're using a local instance, please change this information as appropriate. Connection conn = DriverManager.getConnection("jdbc:sqlserver://;serverName=localhost;integratedSecurity=true;database=archive"); HTH

  • Anonymous
    May 08, 2009
    I have tried every possible solution listed in hundreds of sites with no luck. I can log in with the same credentials through SSMSE with no problem. If I use integratedSecurity=false; then I get "This user is not associated with a trusted SQL Server connection". If I use integratedSecurity=true; then I get the following: May 8, 2009 6:42:24 PM com.microsoft.sqlserver.jdbc.SQLServerConnection SSPIData WARNING: ConnectionID:1 Authentication failed code-2146893052 May 8, 2009 6:42:26 PM com.microsoft.sqlserver.jdbc.AuthenticationJNI SNISecGenClientContext WARNING: InitializeSecurityContext failed with -2146893052{WINERR} This repeats for a few seconds and it tells me the driver is not configured for authentication. I have tried many different things. I have copies of the DLL located in many different areas with no changes to these errors. Any help would be great!

  • Anonymous
    May 08, 2009
    Never mind! My SQL install was not mixed authentication. I used VPN to another server and had no problems with logging in.

  • Anonymous
    May 26, 2009
    The comment has been removed

  • Anonymous
    August 14, 2009
    Anyone else has a solution for this. I also have same problem integrated security=true then i get This driver is not configured for integrated authentication. otherwise user error. Any help Thanks

  • Anonymous
    August 25, 2009
    Gundala, Have you tried the tips above? Are you on Windows? Try to copy the sqljdbc_auth.dll to a directory in the local directory where you are executing your application. See if you still receive your error. -- Tres London [SQL Server]

  • Anonymous
    September 10, 2009
    Tried to use sqljdbc.jar in a Sparc Solaris.. Throws the same message, but can't use a x86 dll. Where can I find the proper Driver?

  • Anonymous
    September 15, 2009
    Hey Carlos, The Windows Authentication feature only works from Windows. We don't yet have a non Windows authentication feature. --Tres London [SQL Server]

  • Anonymous
    November 16, 2009
    Hi, I need help, I'm trying to connect to ms sql2005 database from remote computer all using windows xp. I have no problems running my software in local computer connecting to the ms sql2005 database. However, when i try to connect from remote computer to the ms sql2005 database computer i encounter this error: java.lang.classnotfoundexception com.microsoft.sqlserver.jdbc.SQLServeDriver I dont have ms sql2005 instal in the remote computer.but i have sqljdbc.jar in the remote computer. i try to set the classpath C:Program FilesSMCPLBTreklibsqljdbc.jar also in vain still getting the same error. Pls help. Thanks

  • Anonymous
    February 14, 2010
    Hi, I'm running app on tomcat, i have sqljdbc.jar on classpath, sqljdbc_auth.dll on system path and on java.library.path (can list it on runtime) but i'm still cannot load the dll file (running System.loadLibrary("sqljdbc_auth.dll") throws UnsatisfiedLinkError. Any ideas? Im using win2k3 server sp2.

  • Anonymous
    February 14, 2010
    Ah, forgot to mention - i'm using driver version 2.0 and java 32 bit. I got the proper sqljdbc_auth.dll (from driver.jar/sqljdbc_2.0/enu/auth/x86 folder)

  • Anonymous
    April 19, 2010
    The comment has been removed

  • Anonymous
    April 27, 2010
    I ran into this same issue and the short answer was as follows:

  1. Download the latest driver
  2. Install as per Microsoft Instructions
  3. Open PA Database Connection Manager
  4. Click on JDBC Drivers...
  5. Add new copy propertys from SQL Server 2008
  6. Click on Add Jar... and select the above installed file (from M$).
  7. Click on old driver and click Remove Jar
  8. Test (worked fine after this).
  • Anonymous
    August 14, 2010
    I am trying to connect to SQL server 2008 from within Eclipse. However, I keep getting the message "failed to load sqljdbc_auth.dll. I have this file set in the system Path, eclipse path. The file has been copied to multiple system and application folders, but to no good. Can somebody suggest me steps one by one to configure Eclipse to log on to SQL server 2008? Thanks Raghu

  • Anonymous
    January 17, 2011
    I Microsoft SQL Server JDBC Driver 3.0 on a client machine running WIn7 64bit and I am using Window Server 2008. I am using NT authentication.  Sometimes I get connected to the database with no problem other times I get the following intermittent error: com.microsoft.sqlserver.jdbc.SQLServerConnection SSPIData WARNING: ConnectionID:46 Authentication failed code-2146892976 with the message "This driver is not configured for integrated authentication" Inevitably I reboot the client machine or restart the client application, which seems to increase the odds of a connection being established. jdbc:sqlserver://<my sql server IP address>;database=qai;integratedSecurity=true; Not sure why? Is this just related to a time-out or a path issue? does anyone have any ideas? Should I force the login timeout to be longer?

  • Anonymous
    January 17, 2011
    I Microsoft SQL Server JDBC Driver 3.0 on a client machine running WIn7 64bit and I am using Window Server 2008. I am using NT authentication.  Sometimes I get connected to the database with no problem other times I get the following intermittent error: com.microsoft.sqlserver.jdbc.SQLServerConnection SSPIData WARNING: ConnectionID:46 Authentication failed code-2146892976 with the message "This driver is not configured for integrated authentication" Inevitably I reboot the client machine or restart the client application, which seems to increase the odds of a connection being established. jdbc:sqlserver://<my sql server IP address>;database=qai;integratedSecurity=true; Not sure why? Is this just related to a time-out or a path issue? does anyone have any ideas? Should I force the login timeout to be longer?

  • Anonymous
    February 09, 2011
    Señores: Yo trabajé con la herramienta Rational Functional Tester V.7 en base a el IDE Eclipse y realice la conexión con el MS SQL Server 2008 R2, antes que todo descargue el archivo indicado en todos los blog de MS, para la versión MS SQL Server 2008 R2  conector JDBC. 3.0 de todas formas siempre puedes usar el sqljdbc.jar, donde encontraras la .dll necesaria nombrada "sqljdbc_auth.dll", recuerda chequear la versión para tu procesador, X86(32 Bits),  64 Bits y otra extra que aparece. La mejor opción es copiar el archivo .dll Solución: C:Window y listo, estará todo Ok. Puedes realizar la prueba ahora, el String de conexión que use fue este: String url = "jdbc:sqlserver://localhost;databaseName=Mydatabase;integratedSecurity=true;"; locahost = nombre del servidor. databaseName= nombre de tu base de datos. integratedSecurity=true; indica que ingresara con la "Autenticación Window". Que Dios los bendiga. Cristóbal Ramón Herrera Jara "Write once, run anywhere"

  • Anonymous
    September 18, 2011
    The comment has been removed

  • Anonymous
    March 31, 2013
    Hello, Thank you so much for the instructions. I've been trying for days connect to database and finally did it! Regards

  • Anonymous
    June 25, 2014
    Thanks, that was very useful! I was just about to give up trying to connect via jdbc to SQL Server Express 2012 when I found your page, now I can proceed testing it.

  • Anonymous
    October 22, 2014
    please help me i get the following error but it was working before 2 days Oct 23, 2014 3:39:23 PM com.microsoft.sqlserver.jdbc.AuthenticationJNI GenerateClientContext WARNING: com.microsoft.sqlserver.jdbc.AuthenticationJNI@3e96cf Authentication failed code : -2146893052 com.microsoft.sqlserver.jdbc.SQLServerException: Integrated authentication failed. ClientConnectionId:3cc62292-e44e-4902-9a7a-27efddec5d16 Oct 23, 2014 3:39:23 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet jsp threw exception

  • Anonymous
    March 30, 2015
    i am using netbeans 6.9 and sql server 2005 driver also jdbc 3.0 when i am connecting getting the error "this driver is not configured for integrated Authentication" ple help me rectify this problem........

  • Anonymous
    October 27, 2015
    Hi , i am trying to connect to sql server from my linux machine using integrated security=true. i get below error, could you please help. WARNING: Failed to load the sqljdbc_auth.dll cause : no sqljdbc_auth in java.library.path 15/10/28 02:58:24 ERROR manager.SqlManager: Error executing statement: com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication