Archana Walunj
Read all my blogsSAP CPQ REST API Authentication with JWT token
Preface
Often SAP CPQ APIs require JWT token from the bearer token. This is OAUTH 2.0 Authentication with grant-type = “password”.
SAP CPI currently supports OAuth with grant-type with “Client Credentials”. In this blog we will see how we can to fetch JWT token to access SAP CPQ APIs.
Development Setup
Here I have created iflow with 2 steps. In Step 1, CPI calls SAP CPQ token API to fetch bearer token. In Step 2, CPI calls SAP CPQ with bearer token in order to receiver JWT Token.
Step 1 : Bearer token
SAP CPQ userid and passwords are received with groovy script.
Then a http call is made to SAP CPQ API to receive bearer token – https://eusb.webcomcpq.com/basic/api/token
Bearer token is then saved as a property and is used to create Bearer token. Authorization : Bearer ${header.token}
Step 2: JWT Token
A http call is made to SAP CPQ API to receive bearer token – https://eusb.webcomcpq.com/api/rd/v1/core/GenerateJWT
JWT token is then saved as a property to access other SAP CPQ REST APIs.
Step 3. Simulation
Using POSTMAN, Bearer token is fetched by calling CPQ token API with grant type=password.
This bearer token is used as Authorization to get JWT token.