Access token flow
- Last Updated: May 13, 2025
- 1 minute read
- DataDirect Connectors
- JDBC
- GitHub 6.0
- Documentation
Note: To use OAuth 2.0
authentication, you must first register your application with GitHub. Refer to the GitHub
documentation for more information.
The access token authentication flow passes the access token directly from the client to the GitHub service for authentication. Unlike other grant types, authentication credentials, such as authorization codes, are not exchanged in return for the access code. Instead, the access token has been obtained from sources external to the flow and specified using the AccessToken property.
Note: Access tokens do not expire
unless revoked by the user.
To configure the driver to use an access token flow:
- Set the ServerName property to the GitHub instance to which you want to issue requests. For example, github.enterprise.com.
- Set the AuthenticationMethod property to
OAuth2. - Set the AccessToken property to the value of the access token obtained from external sources.
The following examples show the connection information required to establish a session using the access token flow.
Connection URL
Connection conn = DriverManager.getConnection
("jdbc:datadirect:github:
ServerName=github.enterprise.com;
AuthenticationMethod=OAuth2;
AccessToken=C3TQH9zjwek4CgJCU-4Mxb2DxLNfI2LB3a-dNfpWYx;");
Data Source
GitHubDataSource mds = new GitHubDataSource();
mds.setDescription("My GitHub Data Source");
mds.setServerName("github.enterprise.com");
mds.setAuthenticationMethod("OAuth2");
mds.setAccessToken("C3TQH9zjweek4CgJCU-4Mxb2DxPLNfI2LB3a-dNfpWnYx");