API token is not working as expected.

We want to create an API token. So, that any script with client id and secret could use it and generate access token and can use it further.

With PAT this use case works pretty smooth. But we want to achieve this globally, so that anyone with client id and secrets could generate access token.

We though of using API management Module (Security Setting → API Management) of IDN which gives me client id and secret. But we are not able to generate access token from it. We have tested this in Postman.

Can anyone please provide an update on this?

Hi @AmritRaj , without these and other specific details, it is difficult to tell you exactly why you are unable to generate or automate a token in Postman through this “other” (non-PAT) method:
--what steps were used to generate the client id and secret, if it’s not a PAT
--which grant type was selected for the API client management (see this page: https://developer.sailpoint.com/idn/api/authentication/#choose-authorization-grant-flow)
--which scopes are defined
--the redirect URL (if using the auth code flow)
--Postman authorization configuration details and screen shots
--the error in Postman + console output

For example, configuring the Auth Code flow in Postman requires additional + different settings vs. a PAT: the Callback URL must match exactly, the Auth URL and Access Token URL must be correct. There are at least 12 different reasons I can think of that would cause token generation to fail.

If you have a subscription to Identity University, I recommend watching the QuickLearn series (a series of short videos) called "IdentityNow: Advanced - QUICKLEARN SERIES - there are several Postman configuration demonstrations.

Otherwise, there is more information available in the SailPoint Developer Community, such as:
https://developer.sailpoint.com/idn/api/authentication#request-access-token-with-client-credentials-grant-flow

https://developer.sailpoint.com/idn/api/authentication#request-access-token-with-authorization-code-grant-flow

https://developer.sailpoint.com/idn/api/authentication#request-access-token-with-refresh-token-grant-flow

Thanks for the response, I am aware of this. :slightly_smiling_face:

I have put my queries in below response what I am looking for.

PAT generated from preferences works fine.


I can access all the endpoints weather it is beta,v3 or cc.

BUT THIS IS NOT WHAT I AM LOOKING FOR.

---------------------------------------------------------------------------------------------------------------------------

I want to use it from API management. I am doing this. PFB the screenshot.

Can access V3 but not beta endpoint with the access token generated.


 Can anyone please suggest on this what’s going wrong?

Can anyone please provide an update on this.

Can anyone please provide an update on this.

Hi  @AmritRaj  
The http response code you get is 403 == Authorization Overreach. The typical reason for this error is that the client credentials are insufficient for the api request. Either you are going to an endpoint for which these credentials are not allowed OR the URL destination is incorrect.

In my Postman configuration, I save the clientId and clientSecret in the environment variables, let the Pre-request script of each collection create/reference the accessToken (variable also in the env vars), and set the Authorization of each collection to grab the {{accessToken}} variable. Then, each api call Authorization is set to “inherit auth from parent”.

I am unable to duplicate the experience you have. Here’s what I did:
1. In IdentityNow, Log in as a top level admin, generate a new PAT, then insert the new clientId and clientSecret into the Postman environment vars.
RESULTS: I can successfully retrieve data from both v3 and beta collections: 200 OK
2. Still as Admin, register a new API client, client credentials grant type, and get a new clientId and Secret.
3. In the Postman environment vars, simply replace the clientId and clientSecret values with the new client credentials API management client credentials. No other changes made.
4. Test “get Accounts” API call from both v3 and beta colections
RESULTS: Both of these still work.
5. Test /v3/public-identities and beta/identities
RESULTS: Both of these ALSO work.

Suggestions:
1. Test v3/public-identities. Do not make any other changes. Does this work?
EXPLANATION: If YES, it does work, then the client credentials you generated do NOT have the proper rights OR scope. A End User can access public-identities but not do anything else.
SOLUTION: Log in as Org Admin, generate a NEW client credentials clientId and clientSecret.

2. Look at the client Id and Secret that you copied. Do you have any spaces or carriage returns in ANY of the values you saved in the beta API call? Spaces and carriage return in either value field in Postman will nullify/break credentials.

3. Look at the Postman console. Expand the request body. Look for the exact reason that it failed. Look at the URL - is this correct. Is the client id or client secret set to  “”? If so, then something is wrong with the values you copied OR the auth they had when you generated them (not an admin user at the time of generating them, for example).

4. Study the v3 and beta api calls: one that is successful and 1 that fails with 403 error. What is different. Study and compare every field, every value, every string, every setting, the top of each collection Authorization page. Something is different.

5. Change your Postman config. If you are using the SailPoint Postman workspace collections:
a.) Add the clientId and clientSecret to the environment variables (exactly like that). 
b.) at the top of each collection, ensure that the Authorization is set to “Bearer Token” Value == {{accessToken}}.
c.) ensure that the api request auth is set to “inherit auth from parent” and try sending again. What error do you get?

Because there are various ways to configure Postman, troubleshooting your exact config is challenging in this context and venue. I recommend to focus on the error, what 403 means, and review the Postman console and every setting to find the difference. Look for spaces or carriage returns in any of the client id and secret fields within Postman - those will break an api request. I hope these suggestions lead you to the answer in your config. Something must be different between the 2 collections or api requests.

One idea for alternate configuration: