- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2021 02:21 AM
Hello all,
i'm using scripted REST API where i will recieve request from external client, the authentication i'm going to use is basic authentication with username and password.
Is there a way to get the username that the client will use to access my API using basic authentication?
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2021 02:56 AM
it will give the logged in user, When someone is accessing your api, they have a logged in user which will have a session, at that time it gs.getuser will give the username credential used to access the api.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2021 02:55 AM
Nope.
it would give the username of the API user which called that API
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2021 02:55 AM
yes thank you, it solved my problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2021 03:12 AM
Did you mistakenly marked other response as correct?
Would you mind marking appropriate response as correct.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2021 02:49 AM
You can use gs.getUser in your scripted rest api.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2021 02:50 AM
but this will get my logged in user not the requester user, right?