OAuth 2.0 access token flow
- Last Updated: March 29, 2023
- 1 minute read
- DataDirect Connectors
- JDBC
- Microsoft Sharepoint 6.0
- Documentation
Note: As opposed to using a third-party
application such as Postman, you can use the Progress DataDirect SharePoint Configuration
Manager to obtain an access token to support the access token flow. See Obtain access and refresh tokens using the
Configuration Manager for details.
Note: Access tokens are temporary and must
be replaced to maintain the session without interruption. The life of an access token is
typically one hour.
The following string includes the properties used to connect with the OAuth 2.0 access token flow.
jdbc:datadirect:sharepoint:ServiceURL=serviceurl;AccessToken=access_token;
[property=value[;...]];where:
- serviceurl
- specifies the URL of a SharePoint site (or "site collection"), for example, https://mycorp.sharepoint.com/sites/marketing/global. The URL must include the base URL (https://mycorp.sharepoint.com/), as well as the path to the site (marketing/global). The driver uses the base URL to infer an OData endpoint, and the site path is used to locate the site that will be accessed.
- access_token
- specifies the access token required to authenticate to SharePoint. This property allows you to set the access token manually.
- property=value
- specifies connection property settings. Multiple properties are separated by a semi-colon.
The following example connection string includes the properties for connecting with the OAuth 2.0 access token flow.
Connection conn = DriverManager.getConnection
("jdbc:datadirect:sharepoint:
ServiceURL=https://mycorp.sharepoint.com/sites/marketing/global;
AccessToken=C3TQH9zjwek4CgJCU-4Mxb2DxLNfI2LB3a-dNfpWYx;");