Skip to main content
Question

Issue with OAuth and postman

  • January 13, 2025
  • 3 replies
  • 217 views

Forum|alt.badge.img+3

Hi

 

Having an issue getting access token using postman from our training server

 

  1. created a new IAM client (set Service Accounts and 
    Direct Access Grants to enabled - not sure if required)
  2. Selected OAuth2.0
  3. Add Authorization data to is set to ‘Request Headers’
  4. Populated callback URL, Auth URL and Access Token URL with what I think is correct
  5. Scope is ‘openid microprofile-jwt’
  6. Client auth is ‘Send as Basic Auth Header’

All seems to work except get the following error

{"error":"invalid_grant","error_description":"Code not valid"}

 

I am using Azure auth when getting new access token and we sit behind a http proxy but the logs suggest this all works fine

 

When call to /auth/realms/stantrn1/protocol/openid-connect/token is made, can clearly see auth code being sent similar to format 1.xxxXXXxXxxx….

3 replies

Forum|alt.badge.img+10
  • Hero (Customer)
  • January 15, 2025

could please share your postman configuraiton please?

what grant_type are you using? is it client_credentials or password_credentials?

cause if using password_credentials you will also need a username and password

using a client credentials you’ll need to attach your iam client a service user

 

@dsj  has made a helpfull documentation on this matter 

Authentication in IFS Cloud – DSJ's Blog


Forum|alt.badge.img+3
  • Author
  • Do Gooder (Customer)
  • January 17, 2025

Grant type is “Authorization Code”. I followed instructions on the training course on the academy, I have a VM now and this works but when I try with a training server we have it does not work. Same (or similar configuration) but with error “code not valid”


Forum|alt.badge.img+3
  • Author
  • Do Gooder (Customer)
  • April 2, 2025

FYI, I resolved this by correctly specifying the callback URL.

 

It had to be https://oauth.pstmn.io/v1/callback