The OAuth 2.0 authentication protocol for granting access to REST APIs is now supported for the Adapter for REST.
Prior to configuring OAuth 2.0 authentication, developers must establish the development environment for the application to obtain the client ID and client secret used for grant authorization code and grant client credentials.
The Adapter for REST is under Procedures on the New Datasource drop-down list of the Web Console Connect to Data page. Right-click the adapter and click Configure.
The configuration parameters are shown in the following image.
Enter or select values for the following parameters.
Is the logical name used to identify this particular set of connection attributes. The default is CON01.
Is the part of the URL that is common for calling the various functions within a specific REST API.
Select OAuth from the Security drop-down list.
The OAuth Grant Type drop-down list appears.
Can be one of the following three grant types.
This is used for obtaining an Access Token and Refresh Token using an Authorization Code returned from an Authorization request. The Access Token is automatically renewed using the configured Refresh Token when a request is run.
The relevant parameters display when you select the Grant Type. Enter or select values for the relevant parameters. The list of OAuth parameters follows.
Is the web service provider. Select custom.
Is the URL to the web service when not configured as a REST adapter connection.
Is the Client ID provided by the OAuth implementation of the application being accessed.
Is the Client Secret provided by the OAuth implementation of the application being accessed.
Is the URL used for OAuth authorization to a specific application.
For example, the Authorization URL for the Google set of APIs is https://accounts.google.com/o/oauth2/auth.
Is the URL used for obtaining an Access Token to a specific application using the Authorization Code obtained from the OAuth Authorization request.
For example, the Token URL for the Google set of APIs is https://accounts.google.com/o/oauth2/token.
Are additional parameters needed for the OAuth Authorization request to a specific application.
Are additional parameters needed for the OAuth Token request to a specific application.
Is the Access Token returned from the OAuth Token request.
Is the Refresh Token returned from the OAuth Token request.
Is the user ID used to perform OAuth authentication using the Authorization URL.
Is the password used to perform OAuth authentication using the Authorization URL.
When you have configured the OAuth authentication parameters, click Test to test the connection.
When the test shows that the connection is configured correctly, click Configure.
WebFOCUS | |
Feedback |