- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2024 06:06 AM - edited 08-05-2024 06:27 AM
I have create the Auth Profil and get a Token after i click on "GET OAuth Token".
USING CLIENT CRENDENTIALS
But after a click on Test i get the Message
I Guess the TEST Button does not use the created Token, also i guess that my header is designed for a Script.
How i need to adjust the Form that the TEST UI Action will work for that Rest message?
Do i need to copy the TOken hash?
Also it would be nice if someone can show me a script how to request the token and use it
thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 03:10 AM
The problem was the short validity of my token of 60 seconds, there is a porperty "glide.rest.outbound.oauth_token_expired_threshold" in ServiceNow that a token 60 seconds before expiration date is already invalid, I have set the value to 15 seconds.
No the Test Button works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2024 06:09 AM - edited 08-05-2024 06:14 AM
Hi,
If you have configured your auth profile correctly and have added it to your rest message all should be fine:
If you go to credentials https://<instance>.service-now.com/discovery_credentials_list.do?sysparm_query=&sysparm_view=
and open your credentials, you should be able to use the 'Get OAuth Token' related link to test if your oauth is configured correctly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2024 06:34 AM - edited 08-05-2024 10:56 PM
So, i have added the profil to the Rest Message, in the Get Methode, i use:
If i click GetOAuth Token, it create a Token in manage token List. oauth_credential_list
If i open the discovery credentials List, i have to Record matching my Profil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2024 06:15 AM
if you set the OAuth profile then it should work directly
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2024 06:32 AM
in my case i use