Configuring a Custom Connector to Use OAuth

If you are using any browser-based authentication, for example, OAuth, while connecting to your data source with a custom connector, you need to configure the JDBC configuration file to run as the logged-in user and not as System.

You need to do this only once: upon your first session with the custom connector. This will affect all connections that use the Generic JDBC Connector.

Depending on your driver, you can do this in one of these two methods:

  • For non-CData drivers, use Sisense to generate the OAuth file.
  • For CData drivers, use the driver .jar file of the CData driver to generate the OAuth file.

To configure the JDBC configuration file for non-CData drivers:

  1. Navigate to the description.json file in C:\Program Files\Sisense\DataConnectors\JVMContainer\Connectors\GenericJDBC\

  2. Change the value of "startAsUser" from False to True.
    This value uses the credentials of the user trying to authenticate instead of the Sisense system user.

  3. Restart the Sisense.JVMConnectorsContainer service.

  4. Access Sisense web application via localhost ( http://localhost:8081/ by default, https://localhost for secure connections).

  5. Open Sisense and, in the Connection Wizard, add data using the Generic JDBC connector:
    In the Connection String field, enter <driver name>:InitiateOAuth=GETANDREFRESH;
    Populate the other fields as required.

  6. Find the generated OAuth file with the tokens in the directory %AppData%\Roaming\CData\<Provider Name> \

  7. Copy this .txt file to a different location (for example: C:/Sisense_OAuth_files).

  8. Return to C:\ProgramFiles\Sisense\DataConnectors\JVMContainer\Connectors\GenericJDBC\description.json and change the value of "startAsUser" back to False.

  9. Restart the Sisense.JVMConnectorsContainer service.
    Open Sisense and go to the Connection Wizard. Add the following parameters at the end of your connection string: InitiateOAuth=GETANDREFRESH;OAuthSettingsLocation=<Path_To_Copied_File>/<Copied_File.txt>;
    Populate the other fields as required.

To configure the JDBC configuration file for CData driver:

  1. Double-click the .jar file located in the C:\Program Files\CData\CData JDBC Driver for <DriverName>\lib.

    The Connection String Builder opens.

  2. Change the IntitiateOAuth parameter to GETANDREFRESH and test the connection.

    The web page where you can log in to the data source will open in a new browser tab.

  3. Log in through the web page. This creates an OAuth file under %AppData%\Roaming\CData\<Provider Name> \.

  4. Copy this .txt file to a different location (for example: C:/Sisense_OAuth_files).

  5. Open Sisense and go to the Connection Wizard. Add the following parameters at the end of your connection string: OAuthSettingsLocation=Path_To_Copied_File.txt/<Copied_File.txt>;

    Fill in the other fields as required.