Using Windows Authentication for Microsoft SQL Server

Introduction

Windows Authentication for Microsoft SQL Server allows for secure, integrated authentication between your applications and SQL Server. This guide will walk you through the setup process to configure Joget DX 8 to use Windows Authentication with Microsoft SQL Server 2019, ensuring a seamless and secure connection.

Environment

  • Both Joget DX 8 and MSSQL 2019 are installed in the same Windows 11 operating system.
  • Joget DX 8 uses mssql-jdbc version 9.4.0.jre8 JDBC driver.

How does it work?

  1. You will need to first obtain the mssql-jdbc_auth-9.4.0.x64.dll file needed for integrated authentication.
    Since Joget DX 7.0.24, MSSQL JDBC driver version 9.4.0.jre8 is shipped by default. Therefore, it is advisable to use the same version's dll file.
    Download from the direct link https://github.com/microsoft/mssql-jdbc/releases/download/v9.4.0/mssql-jdbc_auth.zip.
  2. Unzip, and find x64\mssql-jdbc_auth-9.4.0.x64.dll. Place it into a location accessible by Joget, i.e. C:\Joget-DX8-Enterprise\wflow\library.
  3. Edit joget-start.bat and append -Djava.library.path=./wflow/library into JAVA_OPTS.
    Your joget-start.bat may look like this now. 

    Note that line -javaagent:./wflow/glowroot/glowroot.jar must be placed at the end too.
    joget-start.bat
    @ECHO OFF
     
    REM Start MariaDB
    ECHO == Starting MariaDB ==
    ECHO.
    CALL .\mariadb-start.bat
    ECHO.
     
    REM Start Tomcat
    set JAVA_HOME=.\jre11.0.2
    set CATALINA_HOME=.\apache-tomcat-8.5.65
    set JAVA_OPTS=-Xmx768M -Dwflow.home=./wflow/ -javaagent:./wflow/aspectjweaver-1.8.5.jar -Djava.library.path=./wflow/library -javaagent:./wflow/glowroot/glowroot.jar
    REM set JAVA_OPTS=-XX:MaxPermSize=128m -Xmx1024M -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,suspend=n,server=y,address=5115 -Dwflow.home=./wflow/ -javaagent:./wflow/aspectjweaver-1.8.5.jar -javaagent:./wflow/glowroot/glowroot.jar
    ECHO == Starting Tomcat from %CATALINA_HOME% ==
    ECHO.
    %CATALINA_HOME%\bin\catalina.bat run
    Note: If your Joget server runs as Windows service, then you will need to launch tomcat8w.exe to configure JAVA_OPTS variable accordingly.
  4. Initialize your mssql database instance with Joget's base tables.
    Navigate and import the file in the specified directory below into your database, using your database client of choice: 

    <Your Joget folder>\apache-tomcat-<version number>\webapps\jw\WEB-INF\classes\setup\sql\jwdb-mssql.sql
  5. Create a new datasource profile file inside the wflow folder.
    Here's sample content.

    app_datasource-mssql.properties
    workflowDriver=com.microsoft.sqlserver.jdbc.SQLServerDriver
    workflowUrl=jdbc\:sqlserver\://localhost\:1433;SelectMethod\=direct;DatabaseName\=jwdb;integratedSecurity\=true
    workflowPassword=
    workflowUser=sa
    Note: The value in workflowUser is not being used, but it is a required field. Simply key in any value here.
  6. Change your datasource to point to your new profile. 
    inside the same folder, open app_datasource.properties and edit the line currentProfile=default to currentProfile=mssql or currentProfile=<name> where <name> is the name you used for your newly created datasource profile above.

  7. Start Joget server and test.
Created by Julieth Last modified by Aadrian on Dec 13, 2024