3.3.4 Create an Access Token

This topic provides details to create an access token when you use Oracle IDCS or Oracle IAM as the identity provider.

If you want to use Keycloak or Microsoft AD as the identity provider, refer to their product documentation for information about setting up the identity provider and creating an access token.

API calls to the service require a valid access token. Create an access token which you can specify in subsequent API calls to the service. In addition to the access token, you can also specify the refresh token in subsequent API calls to the service. MicroTx uses the refresh token to refresh an expired access token.

Before you begin, ensure that you have set up your identity provider and noted down the values for client ID, client secret, and the domain URL.
  1. Create an access token. See Example Authorization Flow in REST API for Oracle Identity Cloud Service.
  2. Store the access token and refresh tokens in environment variables, as shown in the following example for a Linux host.
    export TOKEN="eyJ4Lm..."
    export REFRESH_TOKEN="ey5Gkr..."
  3. Store the authentication cookie in an environment variable, as shown in the following example for a Linux host.
    export OTMM_COOKIE="eyJh...x_THw"

    The example value has been truncated with ellipses (...) for readability.

After you obtain the OAuth 2.0 tokens, use the tokens in the authorization and refresh-token headers while making subsequent API calls to the service.