Generate User Details Using Access Token
get
/oauth2/v1/userinfo
Request
There are no request parameters for this operation.
Back to TopResponse
Supported Media Types
- application/json
200 Response
User information generated
Root Schema : userinfo
Type:
object
Generate the user information in JSON format.
Show Source
-
birthdate:
string
Birthdate of the user
-
family_name:
string
Family name of the user
-
gender:
string
Gender of the user
-
given_name:
string
First name of the user
-
name:
string
Name of the user
-
preferred_username:
string
User's preferred name
-
sub:
string
Subject provided by the user
-
website:
string
Website provided by the user
400 Response
Invalid request
Root Schema : error
Type:
object
Error message that appears during Revoke Refresh Token
Show Source
-
error:
string
Error values based on the OAuth specification
-
error_description:
string
Detailed error messages
Examples
The following example shows how to obtain user information using an access token by submitting a GET request on the REST resource using cURL. For more information about cURL, see Use cURL. See the Authorization section for more information on grant types.
Example Request Using cURL
Note:
The command in this example uses the URL structurehttps://tenant-base-url/resource-path,
where
tenant-base-url
represents the Identity Service URL, and the resource path represents the Identity Service API. See
Send Requests for the appropriate URL structure to use.
The following shows an example cURL request using an access token to obtain user information
curl -i
-H 'Authorization: Bearer <Access Token Value>'
-H 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8'
--request GET https://tenant-base-url/oauth2/v1/userinfo'
Example of Response Body
The following example shows the contents of the response body in JSON format:
{
"birthdate": "",
"family_name": "opc",
"gender": "",
"given_name": "admin",
"name": "admin opc",
"preferred_username": "admin@example.com",
"sub": "admin@example.com",
"website": ""
}