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

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

Rate This
  • Comments 37

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

Leave a Comment
  • Please add 3 and 4 and type the answer here:
  • Post
  • 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.

  • 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.

  • 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

  • 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!

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

  • I received the above mentioned error when i tried to execute java program used for connection with SQL. plz mail the possibilities to remove this error to

    talk2shreyasb@gmail.com.

  • 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

  • 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]

  • 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?

  • Hey Carlos,

    The Windows Authentication feature only works from Windows. We don't yet have a non Windows authentication feature.

    --Tres London [SQL Server]

  • 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 Files\SMCPL\BTrek\lib\sqljdbc.jar

    also in vain still getting the same error. Pls help. Thanks

  • 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.

  • 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)

  • I am also getting the Failed to load the sqljdbc_auth.dll warning message.

    There has to be a simple fix apart to this.

    I have put the sqljdbc_auth.dll in my

    C:\Windows\System32\sqljdbc_auth.dll

    Then as we all do leave logig behind in the hack an slash method added it to my tomcat lib folder, tomcat bin folder added the following to my tomcat startup.bat

    set JAVA_OPTS=-Djava.library.path=C:\Windows\System32\sqljdbc_auth.dll

    Added it to my system class path.

    Not sure what else I can do unless there is some m,agic I will happily learn

  • 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).

Page 2 of 3 (37 items) 123