SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
⤢ Open full site

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).

Overview

🎓 beginner 5 min. SAP Business Technology PlatformBeginnerCloudSAP HANASAP S 4hanaSAP Document Management ServiceIntegration

You will learn

  • How to generate JSON web token [ACCORDION-BEGIN [Step 1: ](Get access token details from your service key )] 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](Servicekey Details.png) [DONE] [ACCORDION-END] [ACCORDION-BEGIN [Step 2: ](Get JSON web token)] 1. Open the Postman client. Click on New and then select HTTP Request to open a new tab on Postman to work on. !
    Postman
    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 "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 "az_attr":{"X-EcmUserEnc":"<Your BTP user Email ID>","X-EcmAddPrincipals":"<Your first name>" !![Select Post](Select Post Method.png) 4. For encoding, you need to select all the values in the authorities field, right click and select the option EncodeURIComponent. !
    Encoding_Authorities
    Encoding_Authorities
    3. Navigate to Authorization tab and enter the following: | Field Name | Value | :————- | :————- | Type | Basic Auth | Username | clientId | Password | clientSecret Click Send. !
    AuthorizationDetails
    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](JSONWebToken Generated.png) [DONE] [ACCORDION-END] [ACCORDION-BEGIN [Step 3: ](Test yourself)] [VALIDATE_5] [DONE] [ACCORDION-END]
Vikram Kulkarni V Vikram Kulkarni December 10, 2024
Created by December 10, 2024
Contributors

Prerequisites

Prerequisites

Steps

You will learn

  • How to generate JSON web token

Step 1 Get access token details from your service key

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](https://raw.githubusercontent.com/sap-tutorials/btp-adai/main/tutorials/btp-sdm-gwi-onbrepo-jwt-token/Servicekey Details.png)

Step 2 Get JSON web token
+
Step 3 Test yourself
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 3
1. Get access token details from your service key 2. Get JSON web token 3. Test yourself

Learn more →