To retrieve information from SharePoint Online, the connector uses both the SharePoint OData/REST API and the Microsoft Graph API. The SharePoint API supports basic authentication with a user name and password, and OAuth authentication. The Microsoft Graph API requires OAuth authentication.
Micro Focus recommends that you create a certificate-authenticated "App Only" OAuth application to represent the connector, because this can be used to access endpoints in both APIs, and prevents you having to configure authentication for each API separately.
You can create an OAuth application through the Azure portal. More information and full instructions are available in the Microsoft documentation.
To create an OAuth application to represent the connector
Create an OAuth application:
http://localhost:7878/oauth
. This is the default URL that the Micro Focus OAuth configuration tool listens on. The "type" of the redirect URI should be "Web".Click Register.
The application is created.
Click API permissions and grant the relevant permissions.
Actions that read data (synchronize, collect, and view) require the following permissions:
Microsoft Graph > Application Permissions
SharePoint > Application Permissions
Actions that modify data (such as insert or update) require read-write permissions.
After creating the application, you can use the Micro Focus OAuth configuration tool to obtain the tokens that the connector needs to make API requests.
To obtain OAuth tokens
oauth_tool.cfg
in a text editor. In the [Default]
section, specify any SSL or proxy settings required to access the Microsoft APIs:
SSLMethod
|
The version of SSL/TLS to use. |
ProxyHost
|
The host name or IP address of the proxy server to use. |
ProxyPort
|
The port of the proxy server to use. |
In the [OAuthTool_ServiceApp]
section, set the following parameters:
AdminConsentUrl
|
Replace the <TenantId> placeholder with the value you obtained in the previous procedure. |
TokenUrl
|
Replace the <TenantId> placeholder with the value you obtained in the previous procedure. |
CustomValue0
|
Specify the path of your authentication certificate / private key. |
CustomValue1
|
Specify the password for your authentication certificate / private key. |
AppKey
|
The application key (client ID) you obtained when you created the application to represent the connector. |
Open a command-line window and run the following command:
oauth_tool.exe oauth_tool.cfg OAuthTool_ServiceApp
Your default web browser opens to the Microsoft web site.
Authorize the application to access the API.
Microsoft provides the OAuth tokens, and the OAuth configuration tool creates a file named oauth.cfg
. This contains the tokens that the connector requires to authenticate.
Include the OAuth tokens in each of your fetch tasks. For example, you can modify the connector configuration file as follows:
[MyTask1] < "oauth.cfg" [OAUTH]
For more information about including parameters from another file, see Include an External Configuration File. The OAuth tool also prints the parameters it has set to the command-line window so that you can set these directly in the connector's configuration file if you prefer.