Skip to main content

oauth_tokens

Creates, updates, deletes, gets or lists an oauth_tokens resource.

Overview

Nameoauth_tokens
TypeResource
Idokta.users.oauth_tokens

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringID of the Token object (example: oar579Mcp7OUsNTlo0g3)
_embeddedobjectThe embedded resources related to the object if the expand query parameter is specified
_linksobjectSpecifies link relations (see Web Linking) available using the JSON Hypertext Application Language specification. This object is used for dynamic discovery of related resources and lifecycle operations.
clientIdstringClient ID
createdstring (date-time)Timestamp when the object was created (example: 2017-03-28T01:11:10.000Z)
expiresAtstring (date-time)Expiration time of the OAuth 2.0 Token
issuerstringThe complete URL of the authorization server that issued the Token (example: https://{yourOktaDomain}/oauth2/ausain6z9zIedDCxB0h7)
lastUpdatedstring (date-time)Timestamp when the object was last updated
scopesarrayThe scope names attached to the Token
statusstringStatus (example: ACTIVE)
userIdstringThe ID of the user associated with the Token (example: 00u5t60iloOHN9pBi0h7)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_refresh_tokens_for_user_and_clientselectsubdomainexpand, after, limitLists all refresh tokens issued for the specified user and client
get_refresh_token_for_user_and_clientselectsubdomainexpandRetrieves a refresh token issued for the specified user and client
revoke_tokens_for_user_and_clientdeletesubdomainRevokes all refresh tokens issued for the specified user and client
revoke_token_for_user_and_clientdeletesubdomainRevokes the specified refresh and access tokens

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
subdomainstringThe domain of your organization. This can be a provided subdomain of an official okta domain (okta.com, oktapreview.com, etc) or one of your configured custom domains. (default: my-org)
afterstringThe cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the Link response header. See Pagination.
expandstringValid value: scope. If specified, scope details are included in the _embedded attribute.
limitinteger (int32)Specifies the number of tokens to return

SELECT examples

Lists all refresh tokens issued for the specified user and client

SELECT
id,
_embedded,
_links,
clientId,
created,
expiresAt,
issuer,
lastUpdated,
scopes,
status,
userId
FROM okta.users.oauth_tokens
WHERE subdomain = '{{ subdomain }}' -- required
AND expand = '{{ expand }}'
AND after = '{{ after }}'
AND limit = '{{ limit }}';

DELETE examples

Revokes all refresh tokens issued for the specified user and client

DELETE FROM okta.users.oauth_tokens
WHERE subdomain = '{{ subdomain }}' --required;