Skip to Content

Create JSON Web Token (JWT) to Authenticate Onboarding Repository API

In this tutorial, you follow the steps by using the parameters from the service key of the Document Management Service, Integration Option instance to generate a JSON Web Token (JWT).
You will learn
  • How to generate JSON web token
Vikramkulkarni01Vikram KulkarniJune 16, 2023
Created by
Vikramkulkarni01
June 13, 2023
Contributors
Vikramkulkarni01

Prerequisites

  • Step 1

    You will need the following values from your service key in order to get your JSON web access token.

    Navigate to the service that you created in the previous tutorial Create a Service Instance and then a Service Key of SAP Document Management Service, Integration Option.

    access_token Details

  • Step 2
    1. Open the Postman client. Click on New and then select HTTP Request to open a new tab on Postman to work on.

      Postman
    2. Select the POST method and enter the following details:

      1. Copy the url from your service key and append this
        /oauth/token?grant_type=client_credentials&authorities=<AUTHORITIES>
        
      2. Verify that your request URL looks like the following:
        JSON
        Copy
          "url">/oauth/token?grant_type=client_credentials&authorities={"az_attr":{"X-EcmUserEnc":"abc@xyz.com","X-EcmAddPrincipals":"abc"
        
      3. For AUTHORITIES, encode the following values:

        JSON
        Copy
            "az_attr":{"X-EcmUserEnc":"<Your BTP user Email ID>","X-EcmAddPrincipals":"<Your first name>"
        
        Select Post
      4. For encoding, you need to select all the values in the authorities field, right click and select the option EncodeURIComponent.

        Encoding_Authorities
    3. Navigate to Authorization tab and enter the following:

      Field Name Value
      Type Basic Auth
      Username clientId
      Password clientSecret

      Click Send.

      AuthorizationDetails
    4. When a successful response is received, the status is 200 OK. Copy the access_token and save it in a secure area.

      JSOn Webtoken
  • Step 3

    If your response is successful, what is the response status code you receive?

Back to top