Generating SAP Entitlement Management OAuth Credentials

Objective

After completing this lesson, you will be able to generate SAP Entitlement Management API credentials using an SAP BTP subaccount.

OAuth Token

This request obtains an OAuth token for use in subsequent calls to the SAP Entitlement Management API.

Context

The OAuth token is valid for 43199 seconds (12 hours). After that time, you will need to generate a new token.

The authorization endpoint is taken from the XSUAA Service URL, which is obtained from the service key created to access the SAP Entitlement Management API.

Procedure

Follow these steps to obtain the access token:

  1. Go to the Cloud Foundry space, created in the Create Subaccount and Cloud Foundry space.
  2. Open the Service Marketplace EMSOAuthService tile.
  3. Create a new instance and service key if none exist.

    For more details, please refer to sections 3.4 and 3.5 of the Onboarding Guide for SAP Entitlement Management, available on the SAP Help Portal.

  4. Under Service Keys, display the options for the service key that you need and choose Download.

    You see your service key in JSON format.

    The service key includes the following values, depending on its type:

    Service Key Values

    ValueDetails
    Client ID
    • In the uaa object of the service key.
    • Check the value under client_id.
    Client Secret
    • In the uaa object of the service key.
    • Check the value under client_secret.
    Base URL for API Access

    The base URLs for software translation and document translation are different:

    • The base URL for software translation starts with: https://software-translation.

      To complete the base URL, add /translationhub/api to it.

      An example of a base URL for software translation is as follows:

      https://software-translation.api.eu10.translationhub.cloud.sap/translationhub/api

    • The base URL for document translation differs from the base URL for software translation.

      An example of a base URL for document translation is as follows:

      https://document-translation.api.eu10.translationhub.cloud.sap/document-translation/api

      For more information, see the API reference under Document Translation.

    URL for Access Token Endpoint
    • In the uaa object of the service key.
    • Check the value under <url>.
  5. In your API test tool, follow these steps:

    1. Navigate to the Authorization section.
    2. For Type, select OAuth 2.0.
    3. Choose Get New Access Token.
    4. In the Token Name field, enter a name.
    5. In the Auth URL field, enter the authorization endpoint URL (sburl) from the service key.
    6. In the Access Token URL field, enter the token endpoint URL (<url>/oauth/token) from the service key.
    7. In the Client ID field, enter the client ID from the service key.
    8. In the Client Secret field, enter the secret from the service key.
    9. For Grant Type, select Client Credentials.

    You have now created a token. Your API test tool will automatically use it for each request to the SAP Entitlement Management REST API.

Get EMS OAuth Crendential

Summary

Provides step-by-step instructions to create an OAuth2 client-credentials token in SAP BTP that authorizes API calls to SAP Entitlement Management for 12 hours.