It is not possible to get an OAuth Token
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2025 04:32 PM
I just get the response: {"error_description":"access_denied","error":"server_error"}
Here's my view in Application Registries:
As you can see I have a client-id and client-secret set here. Now:
$ curl -XPOST "https://$INSTANCE/oauth_token.do" \
-H "Accept: application/json" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&client_id=$CLIENT_ID&client_secret=$CLIENT_SECRET"
echo
This should work but instead it is giving me the "access_denied" error.
INSTANCE is my "blah.service-now.com" instance hostname. CLIENT_ID and CLIENT_SECRET are from the values shown in my application registry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2025 01:51 PM
Hi @ncastagnet_mc ,
You need to check with the team who has provided that Oauth credentials, the input/output format should match as per SN process.
access_denied, means credentails are not correct or some inputs are missing.
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2025 01:16 PM
Hi @ncastagnet_mc ,
The ServiceNow documentation for using grant type "Client Credential" for inbound requests looks a little different than your setup. You can find the setup here for more inforamtion: https://www.servicenow.com/docs/bundle/xanadu-platform-security/page/integrate/authentication/concep...
But it states as below when and how to use client credentials grant type:
Use the OAuth client credentials grant type for Inbound Integrations from a third party OAuth client to the ServiceNow® platform.
The administrators can use the client credential (CC) grant type to enable integration from a third party OAuth client to the ServiceNow platform.
Inbound client credentials grant type is a capability that can be controlled through a system property. By default the system property is false.
To use the client credentials grant type, you must perform the following steps:
- Create the glide.oauth.inbound.client.credential.grant_type.enabled system property.
- Add the OAuth Application User field to the OAuth Entity form.