Skip to main content

refresh_tokens

Creates, updates, deletes, gets or lists a refresh_tokens resource.

Overview​

Namerefresh_tokens
TypeResource
Idokta.authorizationservers.refresh_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 (ACTIVE, REVOKED) (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
get_refresh_token_for_authorization_server_and_clientselectauthServerId, clientId, tokenId, subdomainexpandRetrieves a refresh token for a Client
list_refresh_tokens_for_authorization_server_and_clientselectauthServerId, clientId, subdomainexpand, after, limitLists all refresh tokens issued by an authorization server for a specific Client
revoke_refresh_token_for_authorization_server_and_clientdeleteauthServerId, clientId, tokenId, subdomainRevokes a refresh token for a Client
revoke_refresh_tokens_for_authorization_server_and_clientdeleteauthServerId, clientId, subdomainRevokes all refresh tokens for a Client

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
authServerIdstringid of the Authorization Server
clientIdstringclient_id of the app
subdomainstring(default: my-org)
tokenIdstringid of Token
afterstringSpecifies the pagination cursor for the next page of tokens
expandstringValid value: scope. If specified, scope details are included in the _embedded attribute.
limitinteger (int32)The maximum number of tokens to return (maximum 200)

SELECT examples​

Retrieves a refresh token for a Client

SELECT
id,
_embedded,
_links,
clientId,
created,
expiresAt,
issuer,
lastUpdated,
scopes,
status,
userId
FROM okta.authorizationservers.refresh_tokens
WHERE authServerId = '{{ authServerId }}' -- required
AND clientId = '{{ clientId }}' -- required
AND tokenId = '{{ tokenId }}' -- required
AND subdomain = '{{ subdomain }}' -- required
AND expand = '{{ expand }}'
;

DELETE examples​

Revokes a refresh token for a Client

DELETE FROM okta.authorizationservers.refresh_tokens
WHERE authServerId = '{{ authServerId }}' --required
AND clientId = '{{ clientId }}' --required
AND tokenId = '{{ tokenId }}' --required
AND subdomain = '{{ subdomain }}' --required
;