Acorel
Gratis demo

SAP CPQ REST API Authentication with JWT token

Archana Walunj, 17 augustus 2022

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

1

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

2

Bearer token is then saved as a property and is used to create Bearer token. Authorization : Bearer ${header.token}

3

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

4

JWT token is then saved as a property to access other SAP CPQ REST APIs.

6

Step 3. Simulation

Using POSTMAN, Bearer token is fetched by calling CPQ token API  with grant type=password.

7

This bearer token is used as Authorization to get JWT token.

8

Archana Walunj

Read all my blogs

Receive our weekly blog by email?
Subscribe here:

More blogs