Uploaded image for project: 'Crucible'
  1. Crucible
  2. CRUC-8650

New MSSQL JDBC driver needed for NTLM authentication from Fisheye

XMLWordPrintable

      Issue Summary

      In Fisheye 4.7.1 we changed the database driver from jtds to the Microsoft JDBC driver.
      The JTDS driver was able to connect to a Windows based Microsoft SQLserver using a Windows account the JTDS driver by specifying the domain parameter.

      jdbc:jtds:sqlserver://MYSQLSERVER;domain=MYDOMAIN;databaseName=crucible;
      

      This is no longer possible with the version of the Microsoft JDBC driver shipped with Fisheye/Crucible.

      Fisheye ships with version 7.2.2. NTLM authentication was added in version 7.4 and extra parameters are needed.

      jdbc:sqlserver://MYSQLSERVER;domain=MYDOMAIN;databaseName=crucible;authenticationScheme=NTLM;integratedSecurity=true;authentication=NotSpecified
      

      This bug is to get the JDBC driver bundled with Fisheye/Crucible to a supported version greater than 7.4.1

      Steps to Reproduce

      Configure the Fisheye database URL to connect to SQL Server which has been configured to use Windows user authentication.

      jdbc:sqlserver://MYSQLSERVER;domain=MYDOMAIN;databaseName=crucible;
      

      The user will not be recognised on the MS SQLServer side.

      If we specify the correct parameters in the database URL then Fisheye/Crucible will reject the URL because NTLM is no a valid authentication method in version 7.2.2.

      Expected Results

      User is able to connect from FisheyeCrucible using Windows account.

      Actual Results

      Try to authenticate against the windows user MYDOMAIN\winuser.

      The below exception is thrown in the fisheye.out file:

      2024-09-20 16:11:53,251 ERROR - Unable to connect to SQLServer 2012 or newer database jdbc:sqlserver://MYSQLSERVER;domain=MYDOMAIN;databaseName=crucible;: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'winuser'. ClientConnectionId:0e0b86ae-2af3-471f-b4c8-115e955d635a
      com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'winuser'. ClientConnectionId:0e0b86ae-2af3-471f-b4c8-115e955d635a
              at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:262) [mssql-jdbc-7.2.2.jre8.jar:?]
              at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(tdsparser.java:258) [mssql-jdbc-7.2.2.jre8.jar:?]
              at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:104) [mssql-jdbc-7.2.2.jre8.jar:?]
      ..
      
      2024-09-24 12:53:05,296 ERROR - Unable to connect to SQLServer 2012 or newer
      database jdbc:sqlserver://MYSQLSERVER;domain=MYDOMAIN;databaseName=crucible;authenticationScheme=NTLM;integratedSecurity=true;authentication=NotSpecified: com.microsoft.sqlserver.jdbc.SQLServerException: The authenticationScheme NTLM is not valid.
      com.microsoft.sqlserver.jdbc.SQLServerException: The authenticationScheme NTLM is not valid.
      at
      com.microsoft.sqlserver.jdbc.AuthenticationScheme.valueOfString(SQLServerDriver.java:186) [mssql-jdbc-7.2.2.jre8.jar:?]
      at
      com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1555) [mssql-jdbc-7.2.2.jre8.jar:?]
      at
      com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1162) [mssql-jdbc-7.2.2.jre8.jar:?]
      ..
      

      Workaround

      Whilst, unsupported a workaround would be to replace the mssql-jdbc-7.2.2.jre8.jar with a later version that supports NTML say mssql-jdbc-7.4.1.jre8.jar

      • move <FISHEYE install directory>/lib/mssql-jdbc-7.2.2.jre8.jar to a different directory.
      • download the newer 7.4.1 driver see the following link.
      • copy this file to <FISHEYE install directory>/lib/mssql-jdbc-7.4.1.jre8.jar
      • change the database URL in the config URL to specify the new parameters.
        • jdbc:sqlserver://MYSQLSERVER;domain=MYDOMAIN;databaseName=crucible;authenticationScheme=NTLM;integratedSecurity=true;authentication=NotSpecified
      • restart Fisheye

              achystoprudov Alexey Chystoprudov
              cberry@atlassian.com Chris Berry (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: