To configure the driver to use bearer token authentication.

  • Set the ServerName property to specifiy the URL of the GitHub service to which you want to issue requests. For example, https://github.enterprise.com for enterprise accounts.
  • Set the SecurityToken property to specify the personal access token assigned to you.

The following examples show the connection information required to establish a connection using the bearer token authentication.

Connection URL

Connection conn = DriverManager.getConnection
  ("jdbc:datadirect:github:ServerName=https://github.enterprise.com;
    SecurityToken=secret;");

Data Source

GitHubDataSource mds = new GitHubDataSource();
mds.setDescription("My GitHub Data Source");
mds.setServerName("github.enterprise.com");
mds.setSecurityToken("secret");