GET
/api/whoamiAuthenticatedWho am I
Returns the identity resolved from the presented credential, plus which auth scheme resolved it, the scope granted to the token and, for a delegated token, who acts on the user's behalf.
operationId
get_api_whoamiAccountAuthentication & permissionsAuthenticated
Any authenticated user
- Accepted credentials
- Access token (Bearer)
Authorization: Bearer <JWT> - Access token (cookie)
cookie "access_token_<api_server_id>"
- Access token (Bearer)
- Who may call
- Any authenticated user
Responses
application/json
Whoami
| Property | Type | Description |
|---|---|---|
| uid* | string | SchemaVaults user id |
| email* | string | null | null | |
| admin* | boolean | |
| scheme* | string | Name of the auth scheme that resolved the credential |
| scope* | string | null | null | Space separated scope granted to the token, or null when it carries no scope claim |
| actor* | object | null | null | Who acts on behalf of the user (a delegated token); null for the user's own token |
| sub* | string | The current actor (RFC 8693 |
| client_id* | string | null | null | The client app the actor acts through |
JSONExample
"uid""string"
"email""string"
"admin"true
"scheme""schemavaults-access-token"
"scope""string"
"actor"
"sub""string"
"client_id""string"
Example request
bashcurl
curl -X GET 'https://example-nextjs-resource-server.schemavaults.com/api/whoami' \
-H 'Authorization: Bearer <access_token>'