Menu

integratedSecurity with jTDS

2015-07-22
2015-07-23
  • Julius Mensing

    Julius Mensing - 2015-07-22

    Hello,

    I was reading through numerous posts and still did not figure this out.
    How is it possible to get the same behavior as integratedSecurity=true offers for the MS JDBC driver with jTDS?

    When using this connection string with my application:

    jdbc.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
    jdbc.url=jdbc:sqlserver://hostname:1433;databaseName=sftwcir01;selectMethod=cursor;sendStringParametersAsUnicode=false;integratedSecurity=true

    it uses my Tomcat user and password for the database and works well.

    I tried to do the same with just:

    jdbc.driverClassName=net.sourceforge.jtds.jdbc.Driver
    jdbc.url=jdbc:jtds:sqlserver://hostname:1433/sftwcir06;useCursors=true;sendStringParametersAsUnicode=false

    However I always get the error: Login failed for user 'sa'

    Tried to use the parameter domain but do not know which domain to specify since the tomcat and MSSQL Server are not part of the domain. When I specify for example "mydomain.local" I get this in the log:

    Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.

    Also tried to use the parameter useNTLMv2=true without any further success.

    Can anyone help?
    Is it actually possible with jTDS to pass on the credentials from the tomcat user to the Database for authentication?

    Thank you,

    Julius

     
    • John Craig

      John Craig - 2015-07-22

      <html>
      <head>
      <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
      </head>
      <body bgcolor="#FFFFFF" text="#000099">
      Hi,



      If it's not listed as an option in the documentation for jTDS for
      the connection string, it's unlikely that it's implemented. I'm
      not able to check the docs at the moment because it appears that
      SourceForge is having infrastructure problems. It's been a while
      since I looked the options, but I don't recall seeing that one.



      I'm not entirely sure I have the latest version of the source
      (what I have is 1.3.1--is 1.3.4 the latest?), but in a quick
      check, there's apparently no mention of integrated security in the
      parameters in net.sourceforge.jtds.jdbc.JtdsConnection.java.



      My guess is that's not a supported capability, but you'd need to
      check the docs related to defining a connection on the current
      version.



      Unfortunately, jTDS, as good as it is, is a bit behind in some
      areas. Some of us need to spend some time working on it!



      John



      Alpha-G Consulting, LLC









      On 7/22/2015 7:33 AM, Julius Mensing wrote:



      Hello,


      I was reading through numerous posts and still did not figure
      this out.

      How is it possible to get the same behavior as
      integratedSecurity=true offers for the MS JDBC driver with
      jTDS?


      When using this connection string with my application:


      jdbc.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver

      jdbc.url=jdbc:sqlserver://hostname:1433;databaseName=sftwcir01;selectMethod=cursor;sendStringParametersAsUnicode=false;integratedSecurity=true


      it uses my Tomcat user and password for the database and
      works well.


      I tried to do the same with just:


      jdbc.driverClassName=net.sourceforge.jtds.jdbc.Driver

      jdbc.url=jdbc:jtds:sqlserver://hostname:1433/sftwcir06;useCursors=true;sendStringParametersAsUnicode=false


      However I always get the error: Login failed for user 'sa'


      Tried to use the parameter domain but do not know which
      domain to specify since the tomcat and MSSQL Server are not
      part of the domain. When I specify for example
      "mydomain.local" I get this in the log:


      Login failed. The login is from an untrusted domain and
      cannot be used with Windows authentication.


      Also tried to use the parameter useNTLMv2=true without any
      further success.


      Can anyone help?

      Is it actually possible with jTDS to pass on the credentials
      from the tomcat user to the Database for authentication?


      Thank you,


      Julius




      integratedSecurity
      with jTDS




      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/jtds/discussion/104388/


      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/




      </body>
      </html>

       
  • Julius Mensing

    Julius Mensing - 2015-07-23

    Hello John,

    thank you for your explanation.

    The latest version of jTDS is 1.3.1. The download package is still online and also includes the paramter list in the HTML folder: https://sourceforge.net/projects/jtds/files/

    So from what I understand then is, that jTDS will only allow domain authentication i.e. the user running Tomcat needs to be a domain user and the same user will be authenticated against the MSSQL server?

    I just do not fully understand for which situation the below scenario would apply then (from README.SSO):

    "Using Windows Single Sign On (SSO) clients will be able to connect to Microsoft SQL Server without providing credentials. It would dynamically read current user's credentials and connect to the database

    ....

    In order to set up the jTDS driver to use Windows Single Sign On, users will have to connect without providing a user name and password. This will only work on Windows."

    And then an example of a connection string is given without any user name and password and without the domain paramter: jdbc:jtds:sqlserver://localhost:1433/LionKing

    Regards,

    Julius

     

Log in to post a comment.