Servicenow API, how could i get the username of user that he used in basic authentication login?

Adham Khaled
Kilo Contributor

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.

1 ACCEPTED SOLUTION

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.

View solution in original post

10 REPLIES 10

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.