API Policies > Security policies > OAuth 2.0 authentication
  

OAuth 2.0 authentication

OAuth 2.0 is a protocol for authorization that provides specific authorization flows for web applications and helps in the secure transmission of information between API consumers and web services. You can create an OAuth 2.0 authentication policy to assign to APIs or operations that invoke a process that uses basic authentication.
API Center uses the client credentials grant type for OAuth 2.0 authentication. To enable OAuth 2.0 authentication, you must create an OAuth 2.0 client. You specify the credentials of an organization user with access to run managed APIs and managed API groups that can use the client for authentication, and generate client credentials.
Client access tokens that you use for OAuth 2.0 authentication time out after a defined timeout period. After a token times out, you can't use it. You must regenerate the token. You set the timeout when you create the OAuth 2.0 client, and you can change it later.
You can now assign multiple managed APIs and managed API groups to a single OAuth 2.0 client. You can create a single OAuth 2.0 client to grant access to specific API sets, simplifying authorization control. Disabling or deleting an OAuth 2.0 client invalidates its authorization token, preventing unauthorized API access.

Creating an OAuth 2.0 client

Create an OAuth 2.0 client that enables API consumers to access APIs with a security policy that uses OAuth 2.0 authentication.
    1On the Configuration page, click Add OAuth 2.0 Client.
    The Add OAuth 2.0 Client wizard appears.
    2Enter the user name and password of an organization user and click Next.
    The user information that you enter here must be an Allowed User of the Application Integration process.
    The Details step appears.
    3Enter a name for the client. The name is case sensitive and must be unique in the organization.
    The name can contain up to 128 characters, including ASCII letters, digits, Japanese characters, and the following special characters: $ ( )[ ] . ? `
    4Optionally, enter a description of the client.
    The description can contain up to 1,024 characters.
    5Enter a timeout value in minutes for the access token.
    The minimum value is 5 minutes and the maximum value is 1440 minutes or 24 hours.
    After a token times out, you can't use it. You must regenerate the token.
    6Click Next.
    The Resources step appears.
    7 Select what managed APIs or managed API groups the OAuth 2.0 client applies to:
    Click Next.
    API Center creates the client. The Generated Credentials step appears.
    8Copy the client credentials and use one of the following methods to send them to API consumers:
    9Click Finish.
    You can view the enabled OAuth 2.0 client on the Informatica OAuth 2.0 Server table on the Authorization tab of the Configuration page.
    10Click the number in the APIs or API Groups columns to view the details of the managed APIs or managed API groups associated with the respective OAuth 2.0 client.
    All APIs or All API Groups in these columns denote that the specific OAuth 2.0 client is associated with all managed APIs or managed API groups.
    You can filter the managed APIs and managed API groups based on the API name.
    When you create an OAuth 2.0 client, you can view all the managed APIs and managed API groups that are currently active, shared, and deprecated. When you edit an OAuth 2.0 client, you can view the list of active, shared, and deprecated managed APIs and managed API groups that are associated with the OAuth 2.0 client.

Managing OAuth 2.0 clients

After you create an OAuth 2.0 client, you can edit or delete it.
    1On the Informatica OAuth 2.0 Server table on the Authorization tab of the Configuration page, click to open the Actions menu of the OAuth 2.0 client.
    2Perform one of the following tasks:

Downloading an OAuth 2.0 clients list

You can download a list of OAuth 2.0 clients.
API Center downloads an Excel file that shows details of the OAuth 2.0 clients that were created since the time the organization was created. The file shows the client name, client description, status, the APIs that the client applies to, and the last updated time for all the OAuth 2.0 clients.
To download the list, on the Informatica OAuth 2.0 Server table on the Authorization tab of the Configuration page, click Download.

Enabling and disabling OAuth 2.0 clients

When you create an OAuth 2.0 client, it is enabled by default. You can disable the client if needed. API consumers can't use disabled OAuth 2.0 clients for authentication.
    1On the Informatica OAuth 2.0 Server table on the Authorization tab of the Configuration page, click to open the Actions menu of the OAuth 2.0 client.
    2Select Disable or Enable.
    The OAuth 2.0 client is disabled or enabled.

Accessing an API with OAuth 2.0 authentication

To access an API, API consumers generate an OAuth 2.0 authorization token and send the token to the API.
The following sections describe the stages of accessing an API that requires OAuth 2.0 authentication:
Generating an OAuth 2.0 authorization token
To generate the token, API consumers authenticate to the IDMC OAuth 2.0 server using the server URL and the OAuth 2.0 client credentials that you send to the API Portal administrator.
API consumers need to submit the following credential information to the OAuth 2.0 server:
You can submit this information using any of the following methods. Choose the method that works best based on the application or software package that you use to invoke the API.
Other combinations such as passing all three parameters in URL are supported but not recommended for security reasons.
Note: If the parameters are duplicated and passed both in the URL and request body, the request body parameters override the URL parameters.
The following image shows an API invocation through Postman with a Basic Authorization header:
Sending the token to the managed API
API consumers pass the token that they receive from the OAuth 2.0 server to the managed API as an Authorization header with the prefix Bearer followed by the token.
The following image shows an API invoked through Postman with a Bearer Token authorization type and the token that the API consumer entered:

Regenerating an OAuth 2.0 client secret

You can regenerate an OAuth 2.0 client secret. When you regenerate the client secret, API Center disables the current client secret.
    1On the Informatica OAuth 2.0 Server table on the Authorization tab of the Configuration page, click to open the Actions menu of the OAuth 2.0 client.
    2Select Regenerate Secret.
    3Enter the password and click Next.
    API Center regenerates the client secret and authorization header value. You can copy the new values and send them to the API consumers.
    4Click Finish.

Rules and guidelines for OAuth 2.0 authentication

Controlling API access is an integral part of development. Authorization is checked dynamically, allowing immediate API access without the need for a new token. Consider the following guidelines for OAuth 2.0 authentication: