/userinfo
Return user claims for the currently authenticated Access Token.
Prerequisites
- A valid bearer Access Token
- Relevant OIDC scopes such as
openid,profile,phone
Method
GET /userinfo
Authentication Requirements
- Bearer token required
Example
Example Request
curl https://localhost:5001/userinfo \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjIwMjYtMDMtMTYifQ..."
Example Response
{
"sub": "42",
"name": "Aisha Khan",
"email": "aisha@example.com",
"phone_number": "+1-555-0100"
}
Error Responses
401 Unauthorizedfor missing or invalid bearer tokens403 Forbiddenif scope or policy prevents claim release
Common Pitfalls
- Calling UserInfo without requesting the relevant identity scopes.
- Expecting API authorization scopes to populate profile claims.
Troubleshooting
- If claims are missing, inspect the requested scopes and the user's available profile data.