/oauth2/userinfo (POST)
const url = 'http://localhost:4000/api/auth/oauth2/userinfo';const options = { method: 'POST', headers: { Authorization: 'Bearer <token>', 'Content-Type': 'application/x-www-form-urlencoded' }, body: new URLSearchParams({access_token: 'example'})};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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=exampleGet 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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”RFC 9449 DPoP proof JWT when using a DPoP-bound access token
Request Body
Section titled “Request Body”object
Example generated
access_token=exampleResponses
Section titled “Responses”User information retrieved successfully
object
Subject identifier (user ID)
User’s email address, included if ‘email’ scope is granted
User’s full name, included if ‘profile’ scope is granted
User’s profile picture URL, included if ‘profile’ scope is granted
User’s given name, included if ‘profile’ scope is granted
User’s family name, included if ‘profile’ scope is granted
Whether the email is verified, included if ‘email’ scope is granted
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.
object
Example generated
{ "message": "example"}Unauthorized - invalid or missing access token
object
Example generated
{ "error": "example", "error_description": "example"}Forbidden - insufficient scope
object
Example generated
{ "error": "example", "error_description": "example"}Not Found. The requested resource was not found.
object
Example generated
{ "message": "example"}Too Many Requests. You have exceeded the rate limit. Try again later.
object
Example generated
{ "message": "example"}Internal Server Error. This is a problem with the server that you cannot fix.
object
Example generated
{ "message": "example"}