Access token API
The access token API provides access token management capabilities. The token endpoints are only accessible with valid API client credentials. A web application can use these endpoints to list or delete active tokens for a specific user. For example, the web application can show the user a list of devices with authenticated sessions, and allow the user to revoke access for a device (by deleting the corresponding token).
List access tokens
Endpoint: GET /oauth/api/v1/users/{userId}/tokens
Parameter | Description |
---|---|
userId |
User identifier |
This endpoint requires basic authentication, using the API client credentials. If the user does not exist, or if the user has no valid access tokens, a 404 Not Found
message is returned. If the user has one or more valid tokens, an array is returned with the following attributes.
Attribute | Description |
---|---|
id |
UUID identifying the token. |
client_name |
Name specified for the client that has access to the user's resources via this token. |
device_name |
Name of the device that this token is granted to. It might be not present, because this attribute only contains a value if there is a dynamically registered client. |
created_at |
Timestamp of the moment the access token was created. |
scopes |
String array with scopes that were granted for this access token. |
type |
The authentication method to be used with this access token. |
refresh_token_issued |
Indicates whether a refresh token has been issued alongside the access token. |
expired |
Indicates whether the access token has expired. Tokens without an issued refresh token are omitted from the response after they expire. |
Example response
Example error response
Delete or revoke access token
Endpoint: DELETE /oauth/api/v1/users/{userId}/tokens/{tokenId}
Parameter | Description |
---|---|
userId |
Identifier of the user |
tokenId |
Identifier of the access token |
This endpoint requires basic authentication, using the API client credentials. This endpoint returns a 204 No Content
message regardless of whether the user or token existed before deletion.