Application Registries Issue to generate access token

Roshnee Dash
Tera Guru

Hi,

I have created a application registry  'Create an OAuth API endpoint for external clients'.

RoshneeDash_0-1753856518045.png

Here the webservice user has admin and snc_internal role. For this user 

RoshneeDash_1-1753856586432.png

when I am trying to generate the access token for this instance from postman I am receiving 401 error.
I checked with the client_id, client_secret and user password. I am sending correct value only.
But still receiving 401 issue.
Can anyone please help me with this issue? Either I am missing any step or what is the mistake on this?

Your feedback makes the community stronger! If you found this helpful, marking it as the correct answer helps others.
Stay awesome,
Roshnee Dash
14 REPLIES 14

@Roshnee Dash 

But in real-time you won't give admin role to the API user.

Remove that and check this

The ACL on the oauth_credential table might be causing this issue. Try adding a read ACL on the table and provide the role who needs this access to call and you should be able to test it.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Yes after checking I had removed the admin access @Ankur Bawiskar  but from postman getting 401 error.

Your feedback makes the community stronger! If you found this helpful, marking it as the correct answer helps others.
Stay awesome,
Roshnee Dash

@Roshnee Dash 

I believe I answered your question.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar 

Its not yet resolved. One more thing I observed is if I am changing the grant_type to password for the same application registry than its working. But If I am changing to client credential than its not working.

Your feedback makes the community stronger! If you found this helpful, marking it as the correct answer helps others.
Stay awesome,
Roshnee Dash

@Roshnee Dash 

401 means you are using incorrect credentials of the API user of the target instance?

Also in the target instance the user should have access to the OAuth token table to generate the token.

Once 401 is resolved and you are able to get token all good.

If error is not 401 then some other error might come, it would be mostly that access denied.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader