Accessing APIs with OAuth

You can access the IBM® Guardium® Exposure Manager APIs by using the OAuth access token that is exchanged for the generated OAuth client ID and secret when your application was registered.

Before you begin

After you register the OAuth client applications and retrieve the OAuth token, you can use the token to authenticate to the API.

Procedure

  1. Generate the OAuth basic token by using only one of the following methods:
    • Call the Get access token API from the AuthServer API. For more information, see Calling APIs.
    • Run the following command from a terminal:
      curl -X 'GET' \
            'https://<hostname>/api/v3/oauth/token' \       
            -H 'accept: application/json' \       
            -H 'authorization: Basic <base64_encoded_credentials>'
      Tip: You can generate the base64_encoded_credentials by running the following command in Bash shell:
      echo -n "client_id:client_secret" | base64

      Replace hostname, base64_encoded_credentials, client_id, and client_secret with your actual values.

  2. After you create the basic token, you can use it to run any API. Use this token for every API call as part of the authorization header. For more information, see Creating API keys.