Rest Api explorer authorization
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2022 11:58 AM
experts the "rest api explorer" in servicenow , the authorization field is always readonly OOB with value of "send as me" .
Is there a way to change it to use "a different credential " for testing purposes?
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2022 12:12 PM
Hi
You can impersonate a user with 'rest_api_explorer' role & use the rest api explorer it will use that user's credentials.
Additionally, you can note down that user's token & end impersonation.
Then enter it in the header as shown below:
Please mark this response correct if it resolves your query.
Thanks,
Nikita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2022 04:32 PM
but which authorization will take precedence "send as me" or created token header. where do you specify the credential
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2022 02:14 AM
Hi
The created user's token will take the precedence, if you want you can verify the same by writing a scripted rest API and restrict the authorization to the user token...say set an authorization error if anyone else tries to access with a different token. Here's a pictorial representation of what I mean:
1. Unauthorized attempt
2. Authorized attempt
Let me know if you need any more clarification.
If this resolves your query please mark the answer as correct.
Thanks,
Nikita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2022 12:20 AM
Hi @craigsnowadmin2
Did my reply answer your question?
If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.
Thanks
Nikita