Skip to content

Request user information

User information is encoded inside the ID token returned along with the access token. In addition to that, OpenID Connect provides the userinfo endpoint to obtain user information as a payload. The application should send a request with the access token to invoke the userinfo endpoint.

Userinfo endpoint


Sample request

curl --location --request GET 'https://localhost:9443/oauth2/userinfo' \
--header 'Authorization: Bearer {your_access_token}'
var settings = {
    "url": "https://localhost:9443/oauth2/userinfo",
    "method": "GET",
    "timeout": 0,
    "headers": {
        "Authorization": "Bearer {your_access_token}"

$.ajax(settings).done(function (response) {
var axios = require('axios');

var config = {
    method: 'get',
    url: 'https://localhost:9443/oauth2/userinfo',
    headers: {
        'Authorization': 'Bearer {your_access_token}'

    .then(function (response) {
    .catch(function (error) {

Default sample response
WSO2 Identity Server returns only the sub claim if there are no user attributes shared with the application.

  "sub": "e46ffa67-100d-4329-9460-b8251d446518"

You can customize the user information in the response by configuring user attributes on the registered application.