Skip to main content

secrets

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

Overview

Namesecrets
TypeResource
Idokta.apps.secrets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe unique ID of the OAuth Client Secret (example: ocs2f4zrZbs8nUa7p0g4)
_linksobjectSpecifies link relations (see Web Linking) available for the current status of an application using the JSON Hypertext Application Language specification. This object is used for dynamic discovery of related resources and lifecycle operations.
client_secretstringThe OAuth 2.0 client secret string (example: DRUFXGF9XbLn......a3x3POBiIxDreBCdZuFs5B)
createdstringTimestamp when the OAuth Client 2.0 Secret was created (example: 2023-02-21T20:08:24.000Z)
lastUpdatedstringTimestamp when the OAuth Client 2.0 Secret was updated (example: 2023-02-21T20:08:24.000Z)
secret_hashstringOAuth 2.0 client secret string hash (example: yk4SVx4sUWVJVbHt6M-UPA)
statusstringStatus of the OAuth 2.0 Client Secret (example: ACTIVE, default: ACTIVE)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_oauth2_client_secretsselectsubdomainLists all client secrets for an OAuth 2.0 client app
get_oauth2_client_secretselectsubdomainRetrieves an OAuth 2.0 Client Secret by secretId
create_oauth2_client_secretinsertsubdomainCreates an OAuth 2.0 Client Secret object with a new active client secret. You can create up to two Secret objects. An error is returned if you attempt to create more than two Secret objects.
> Note: This API lets you bring your own secret. If token_endpoint_auth_method of the app is client_secret_jwt, then the minimum length of client_secret is 32 characters. If no secret is specified in the request, Okta adds a new system-generated secret.
delete_oauth2_client_secretdeletesubdomainDeletes an OAuth 2.0 Client Secret by secretId. You can only delete an inactive Secret.
activate_oauth2_client_secretexecsubdomainActivates an OAuth 2.0 Client Secret by secretId
deactivate_oauth2_client_secretexecsubdomainDeactivates an OAuth 2.0 Client Secret by secretId. You can't deactivate a secret if it's the only secret of the 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
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)

SELECT examples

Lists all client secrets for an OAuth 2.0 client app

SELECT
id,
_links,
client_secret,
created,
lastUpdated,
secret_hash,
status
FROM okta.apps.secrets
WHERE subdomain = '{{ subdomain }}' -- required;

INSERT examples

Creates an OAuth 2.0 Client Secret object with a new active client secret. You can create up to two Secret objects. An error is returned if you attempt to create more than two Secret objects.
> Note: This API lets you bring your own secret. If token_endpoint_auth_method of the app is client_secret_jwt, then the minimum length of client_secret is 32 characters. If no secret is specified in the request, Okta adds a new system-generated secret.

INSERT INTO okta.apps.secrets (
data__client_secret,
data__status,
subdomain
)
SELECT
'{{ client_secret }}',
'{{ status }}',
'{{ subdomain }}'
RETURNING
id,
_links,
client_secret,
created,
lastUpdated,
secret_hash,
status
;

DELETE examples

Deletes an OAuth 2.0 Client Secret by secretId. You can only delete an inactive Secret.

DELETE FROM okta.apps.secrets
WHERE subdomain = '{{ subdomain }}' --required;

Lifecycle Methods

Activates an OAuth 2.0 Client Secret by secretId

EXEC okta.apps.secrets.activate_oauth2_client_secret 
@subdomain='{{ subdomain }}' --required;