How to get access token with other instance client_id and client_secret?

Randy25
Kilo Contributor

Hi, I have registered Oauth on my devinstanceA and I can get the access token from https://devinstanceA.service-now.com/oauth_token.do.

But when I tried to get devinstanceB access token with devinstanceA client_id and client_secret. I got 401 error with message: 

unauthorized_client: The client credentials provided (those of the service you are using) are either not valid or not trusted.

P.S. InstanceA and B are developer instance.

1 ACCEPTED SOLUTION

The way we have chosen to implement is to have a different Client ID/Client Secret in each environment for the same account.  For example: We can create an application registry in different environments all called ABCGroup.  Allow the system to generate the client secret and provide the Client ID and Client Secret to the user/group, along with the  endpoints (environment specific). 

View solution in original post

8 REPLIES 8

chrissquires1
Tera Guru

The Client ID is, and Client Secret can be, system generated in each instance unless you have migrated them from your instanceA to instanceB Application Registry. That might be the issue you're having.  And...dumb question here, but have you also updated your URL to instanceB in your POST for oauth_token.do?

Yes, I have updated URL to instanceB in my POST for the token. (https://devinstanceB.service-now.com/oauth_token.do.)

 

Can you teach me how to migrate Client ID and Secret from my instanceA to instanceB Application Registry?

 

Thank you for the help.

Randy,

You can capture the OAuth registries in an Update set from devInstance Aand move them to devInstanceB

Thank you,

Aman Gurram

Randy25
Kilo Contributor

Can I get the access token of instanceA with the same ID and secret if I move them to instanceB?

 

I didn't find where to capture and move them, can you describe it more specifically?