Skip to content

/oauth2/userinfo (POST)

POST
/oauth2/userinfo
curl --request POST \
--url http://localhost:4000/api/auth/oauth2/userinfo \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data access_token=example

Get OpenID Connect user information (UserInfo endpoint)

Send the access token as Authorization: Bearer <token>. Returns sub, plus email and email_verified when the token has the email scope. Refuses tokens issued before a revocation.

DPoP
string

RFC 9449 DPoP proof JWT when using a DPoP-bound access token

Media typeapplication/x-www-form-urlencoded
object
access_token
string

Example generated

access_token=example

User information retrieved successfully

Media typeapplication/json
object
sub
required

Subject identifier (user ID)

string
email

User’s email address, included if ‘email’ scope is granted

string | null format: email
name

User’s full name, included if ‘profile’ scope is granted

string | null
picture

User’s profile picture URL, included if ‘profile’ scope is granted

string | null format: uri
given_name

User’s given name, included if ‘profile’ scope is granted

string | null
family_name

User’s family name, included if ‘profile’ scope is granted

string | null
email_verified

Whether the email is verified, included if ‘email’ scope is granted

boolean | null

Example generated

{
"sub": "example",
"email": "hello@example.com",
"name": "example",
"picture": "https://example.com",
"given_name": "example",
"family_name": "example",
"email_verified": true
}

Bad Request. Usually due to missing parameters, or invalid parameters.

Media typeapplication/json
object
message
required
string

Example generated

{
"message": "example"
}

Unauthorized - invalid or missing access token

Media typeapplication/json
object
error
required
string
error_description
string

Example generated

{
"error": "example",
"error_description": "example"
}

Forbidden - insufficient scope

Media typeapplication/json
object
error
required
string
error_description
string

Example generated

{
"error": "example",
"error_description": "example"
}

Not Found. The requested resource was not found.

Media typeapplication/json
object
message
string

Example generated

{
"message": "example"
}

Too Many Requests. You have exceeded the rate limit. Try again later.

Media typeapplication/json
object
message
string

Example generated

{
"message": "example"
}

Internal Server Error. This is a problem with the server that you cannot fix.

Media typeapplication/json
object
message
string

Example generated

{
"message": "example"
}