Sandbox Personal Access Tokens

I’m having trouble generating token in Sandbox tenant using Personal Access Tokens: I’m using this URL

https://nameOftenant-sb.api.identitynow.com/oauth/token?grant_type=client_credentials&client_id=ClientID&client_secret=ClientSecret

I get 401 error for personal access tokens that I created in the sandbox tenant.

Token can be generated using API via Security Settings in postman but it fails in Powershell script. Did anyone else experience this?

Thank you
Ranjani

At first glance you have the correct URL

https://`{{tenant}}-sb.api.identitynow.com/oauth/token?grant_type=client_credentials&client_id={{client_id}}&client_secret={{client_secret}}`

Looking at your comment here:

Token can be generated using API via Security Settings in postman but it fails in Powershell script. Did anyone else experience this?

If you are able to get the token in postman but not in a Powershell script it may be that you are not providing an additional header required for the post request. Try adding the header Content-Type. In Postman this is done automatically.

For Example:

Invoke-WebRequest https://`{{tenant}}`-sb.api.identitynow.com/oauth/token?grant_type=client_credentials&client_id=`{{client_id}}`&client_secret=`{{client_secret}}` -Headers @{"Content-Type"="application/x-www-form-urlencoded"}

Hi Ranjani

401 error returned for unauthorized due to no proper Header supplied or JWT token expired. Pls do verify your power shell script with proper header.

Martin V Savier

Tyler, Martin

thank you for the response. The first issue that I’m trying to solve is I cannot get PAT that I generated in sandbox → preferences to generate tokens in postman. I checked the headers and it matches with other working request.

@ranjanik

If you have verified that the URL is correct, and that your client credentials are copied correctly. My next recommendation would be to re-generate another set of client credentials and try with a different set.

@ranjanik

Did you solve this issue?
I am having a similar issue - postman is throwing an invalid_client error when i try to get an oauth 2.0 access token using client credentials flow.

my authentication url is copied directly from here:

Authentication | SailPoint Developer Community(Authentication | SailPoint Developer Community)

but using my tenant, secret and client id.

I’ve regenerated a Personal Access Token multiple times and I’ve used a global API token also with the same result.

@rs_lseg can you verify that your postman configuration is as follows?

@colin_mckibben

I use some environment variables but otherwise yes it looks the same - see the attached screenshot.

It’s worth noting that I’m using browser based postman.