ServiceNow OAuth: User/Instance Profile Info endpoint? All services with OAuth support do.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2023 06:22 AM - edited 08-26-2023 09:41 AM
Does ServiceNow OAuth have a User/Instance Profile Info endpoint?
This endpoint returns helpful profile information regarding an unexpired access token.
Requirement: Integration service requires an OAuth profile info endpoint, along with authentication and token endpoints.
This endpoint is provided by every service that handles OAuth: Google, DocuSign, Salesforce, Dropbox, Box, Microsoft, HubSpot...
As a suggestion for ServiceNow, return minimally:
{
"instance_id": "dev1234567",
"scopes": [***],
"expires": 1500
}
Examples of Google and HubSpot OAuths providing OAuth profile info endpoints:
A) Google OAuth User Profile Info per Access Token
curl -SLG 'https://www.googleapis.com/oauth2/v3/userinfo'
--data-urlencode "access_token=[ACCESS_TOKEN]"
--request GET
{
"sub": "[SUB ACCOUNT ID]",
"name": "[USER NAME]",
"given_name": "[FIRST NAME]",
"family_name": "[LAST NAME]",
"email": "[USER EMAIL]",
"email_verified": true,
"locale": "en",
"hd": "[USER DOMAIN]"
}
B) HubSpot OAuth User Profile Info per Access Token
curl "https://api.hubapi.com/oauth/v1/access-tokens/{ACCESS_TOKEN}"
--request GET
{
"token": "[ACCESS_TOKEN]",
"user": "[USER NAME]",
"hub_domain": "[HUB ACCOUNT DOMAIN]",
"scopes": [***],
"hub_id": [ACCOUNT ID],
"app_id": [APP ID],
"expires_in": 55,
"user_id": [USER ID],
"token_type": "access"
}
Thank you, appreciate those reading this post.