Setup IAM Client for a Simple POSTMAN Request

 


In this post I'll explain how we can send simple request using Postman client to get list of array in 'Unit of Measure' screen.


Setup IAM Client:

Go to IAM Clients window and click on + icon to create new client.


Please fill the data like below.


Client ID: POSTMAN_CLT (This should be an unique value, no spaces and no special characters allowed)

Description: Postman Client (Meaning full description to identify the client)

Redirect Url:

 https://appvdvnqa007.academy.ifs.com/*  (This should be your IFS Cloud host url end up with asterisk mark)

Don't forget to enabled flag switched on. When saving the record client secret will be generated.

Setup POSTMAN:

Go to API Explorer window and search for the projection 'IsoUnitsOfMeasureHandling'


Click on the three dotted icon and go to Documentation > API Doc


It will open a new tab like below, there click on the AUTHORIZATIONS to expand the details, here you can see the Connect URL. Copy this url somewhere, you will need this later.

Connect URL:

 https://appvdvnqa007.academy.ifs.com/auth/realms/academydev/.well-known/openid-configuration


In this example we're going to get the list of data in Unit of Measure window expand the Get request in IsoUnitSet and copy the url  highlighted in right hand side.

Request Url:

https://appvdvnqa007.academy.ifs.com/main/ifsapplications/projection/v1/IsoUnitsOfMeasureHandling.svc/IsoUnitSet


Open Postman and put the url in the field and try to send the request, as expected you will get a error indicating that Authorization Required.

Let's setup the Authorization now.

Go to Authorization tab in Postman and set values like below.

Type: OAuth 2.0

Header Prefix: Bearer (Keep as it is)

Token Name: Use an unique name

Grant Type: Authorization Code (Keep as it is)

Callback URL: Copy from the IAM client (See on the top of this article)


Now go the Connect URL which we have taken from the API Explorer, we will need that to get Auth URL and Access Token URL.

Connect URL: https://appvdvnqa007.academy.ifs.com/auth/realms/academydev/.well-known/openid-configuration


In that link authorization_endpoint is the Auth URL you need to put on Postman and token_endpoint is the Access Token URL.

Auth URL: Copy the URL from above and paste.

Access Token URL: Copy the URL from above and paste.

Client ID: Copy from the IAM client (See on the top of this article)

Client Secret: Copy from the IAM client (See on the top of this article)

Scope: openid microprofile-jwt (Copy and Paste as it is)

Client Authentication: Send as Basic Auth Header

Now set is completed and click on the Get New Action Token button, if everything properly entered it will display a successful message like below.


After few seconds (or click Proceed) it will open another dialog like below with an Access Token. Click on Use Token button to use this token in your requests.


Now when click Send button you will be able to get the Status: 200 OK response with data.


Note: Please remember to use your environment URLs instead of the URLs displaying here.


Post a Comment

0 Comments