i created a oauth profile to connect to a third party oauth provider - invalid client credentials
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2025 09:36 PM
Hi,
I have created an POST method to get the token from the server.Prviously, i have used No Authentication, with the client id client secret and grant_type passed in the Content of Outbound Rest Message.
Now, I want to use system property to store the endpoint, clientid, client secret and grant type in a sys_property and use that in the script include.
I tried to create an oauth profile, but it is giving me Invalid client credentials but i tried to test it using postman, it is working.
So, tell me how can i use No authentication and store the details in sys_property.
Below is the implementation done by me,
As i said I have one outbound rest message which has the endpoint and inside that i have created one POST message with the endpoint stored in ${x_abc.token.endpoint} and then in the same post method i have HTTP parameters and in the content i have :
client_id =${x_abc.icu_token_client_id}&client_secret=${x_abc.icu_token_client_secret}&grant_type=client_credentials
So, for this i have created 3 system properties in sys_properties table and in the UI action, i have called them sing below is the function to get the access token,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2025 03:01 AM
Please share screenshots how are you hitting it via postman?
do something similar from ServiceNow as well.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2025 05:48 AM
Hello, may be it is the issue with sys_property. Check this thread,
Solved: Re: Issue: Dynamic Script condition in SLA filter ... - Page 3 - ServiceNow Community
As mentioned by @Ankur Bawiskar
gs.getProperty() has some issues when called from client callable script include
use GlideRecord to query sys_properties table with your name of property and then return the value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2025 02:45 AM
Script include is not client callable.