Get user profile given OAuth access_token
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2018 08:56 AM
Hi,
Given an OAuth access_token (acquired using the grant_type as password). Is it possible to resolve the current user from sys_user table?
I'm assuming that given that I get the access_token given the client credentials the token should somehow be tied to the client.
If it's not possible to resolve the user via access_token - What is the bestpracticee in terms of aligning the token and user for a client application accessing ServiceNow?
- Labels:
-
Best Practices
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2018 03:21 AM
You need to create a Scripted rest API for that and you could call the same with OAuth token to get user info.
From left nav type 'Scripted rest Api' and create new record. Fill out the form with unique name and API Id. Then create new resource from resources related list. Enter any unique name and then script like below
You could use Rest Api Explorer related link for testing the web service.