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 2.0 client secret (example: ocs2f4zrZbs8nUa7p0g4)
_linksobjectSpecifies link relations (see Web Linking) available for the current status of an app 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 2.0 client secret was created (example: 2023-02-21T20:08:24.000Z)
lastUpdatedstringTimestamp when the OAuth 2.0 client 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 (ACTIVE, INACTIVE) (example: ACTIVE, default: ACTIVE)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_oauth2_client_secretselectappId, secretId, subdomainRetrieves an OAuth 2.0 client secrets by secretId
list_oauth2_client_secretsselectappId, subdomainLists all client secrets for an OAuth 2.0 client app
create_oauth2_client_secretinsertappId, subdomainCreates 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_secretdeleteappId, secretId, subdomainDeletes an OAuth 2.0 client secret by secretId. You can only delete an inactive secret.
activate_oauth2_client_secretexecappId, secretId, subdomainActivates an OAuth 2.0 client secret by secretId
deactivate_oauth2_client_secretexecappId, secretId, subdomainDeactivates 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
appIdstringApplication ID
secretIdstringUnique id of the OAuth 2.0 client secret (example: ocs2f4zrZbs8nUa7p0g4)
subdomainstring(default: my-org)

SELECT examples​

Retrieves an OAuth 2.0 client secrets by secretId

SELECT
id,
_links,
client_secret,
created,
lastUpdated,
secret_hash,
status
FROM okta.apps.secrets
WHERE appId = '{{ appId }}' -- required
AND secretId = '{{ secretId }}' -- required
AND 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 (
client_secret,
status,
appId,
subdomain
)
SELECT
'{{ client_secret }}',
'{{ status }}',
'{{ appId }}',
'{{ 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 appId = '{{ appId }}' --required
AND secretId = '{{ secretId }}' --required
AND subdomain = '{{ subdomain }}' --required
;

Lifecycle Methods​

Activates an OAuth 2.0 client secret by secretId

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