/userinfo
Answers the signed-in user’s profile for an access token. A backend that is handed a user’s token can ask here whose it is, rather than trusting what the caller says.
Authentication
Section titled “Authentication”| Token | Send |
|---|---|
Not bound (token_type Bearer) |
Authorization: Bearer <access token> |
DPoP-bound (token_type DPoP) |
Authorization: DPoP <access token> and a DPoP proof for this request: htm the request’s method, htu {issuer}/userinfo, and ath the hash of the token. |
The token must be signed by this environment, unexpired, and granted the openid scope. Its audience is not checked, so a token for any of your APIs works, as long as it has openid. Its session must still be active and its user too: a session that was ended stops answering here at once, even though the token itself has not expired.
Machine-client tokens have no openid scope and no user, and are refused with insufficient_scope.
The answer
Section titled “The answer”sub always, then the claims the token’s scope gives:
| Scope | Claims |
|---|---|
| (any) | sub: the user’s id, stable within the environment. |
profile |
name, picture, when the user has them. |
email |
email, email_verified, when the user has an address. |
phone |
phone_number, phone_number_verified, when the user has a number. |
GET /userinfo HTTP/1.1Host: your-app.auth.dev.seek.servicesAuthorization: DPoP eyJhbGciOiJFUzI1NiIsInR5cCI6ImF0K2p3dCIs…DPoP: eyJ0eXAiOiJkcG9wK2p3dCIsImFsZyI6IkVTMjU2Iiwi…{ "sub": "0b9f6c1e-4d7a-4c55-9a1e-2f3b8d6c7e10", "name": "Ada Lovelace", "email_verified": true}Errors
Section titled “Errors”| Situation | Status | error |
WWW-Authenticate |
|---|---|---|---|
| No token, or an unknown scheme | 401 | invalid_token |
Bearer error="invalid_token" |
| A signature, issuer or type that does not verify | 401 | invalid_token |
Bearer error="invalid_token" |
| An expired token | 401 | invalid_token |
Bearer error="invalid_token" |
A bound token sent as Bearer, or an unbound one sent as DPoP |
401 | invalid_token |
Bearer error="invalid_token" |
| The session has ended, or the user is disabled | 401 | invalid_token |
Bearer error="invalid_token" |
DPoP scheme without a proof, a proof that does not verify or was replayed, or one from another key |
400 | invalid_dpop_proof |
DPoP error="invalid_dpop_proof", algs="ES256" |
The token has no openid scope |
403 | insufficient_scope |
none |
Errors have the OAuth shape, { "error", "error_description" }; see OAuth errors.
In the SDKs: auth-js’s TokenClient.userinfo(accessToken) sends the proof for you, and the Rust SDK’s AuthClient::userinfo asks with an unbound token. See auth-js and auth-client.