Skip to main content

oauth2_resource_server_jwks

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

Overview

Nameoauth2_resource_server_jwks
TypeResource
Idokta.authorizationservers.oauth2_resource_server_jwks

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe unique ID of the JSON Web Key (example: apk2f4zrZbs8nUa7p0g4)
_linksobjectSpecifies link relations (see Web Linking) available for the current status of a JSON Web Key using the JSON Hypertext Application Language specification. This object is used for dynamic discovery of related resources and lifecycle operations.
createdstringTimestamp when the JSON Web Key was created (example: 2023-02-21T20:08:24.000Z)
estringRSA key value (exponent) for key binding (example: AQAB)
kidstringUnique identifier of the JSON Web Key in the Custom Authorization Server's Public JWKS (example: SIMcCQNY3uwXoW3y0vf6VxiBb5n9pf8L2fK8d-FIbm4)
ktystringCryptographic algorithm family for the certificate's key pair (example: RSA)
lastUpdatedstringTimestamp when the JSON Web Key was updated (example: 2023-02-21T20:08:24.000Z)
nstringRSA key value (modulus) for key binding (example: mkC6yAJVvFwUlmM9gKjb2d-YK5qHFt-mXSsbjWKKs4EfNm-BoQeeovBZtSACyaqLc8IYFTPEURFcbDQ9DkAL04uUIRD2gaHYY7uK0jsluEaXGq2RAIsmzAwNTzkiDw4q9pDL_q7n0f_SDt1TsMaMQayB6bU5jWsmqcWJ8MCRJ1aJMjZ16un5UVx51IIeCbe4QRDxEXGAvYNczsBoZxspDt28esSpq5W0dBFxcyGVudyl54Er3FzAguhgfMVjH-bUec9j2Tl40qDTktrYgYfxz9pfjm01Hl4WYP1YQxeETpSL7cQ5Ihz4jGDtHUEOcZ4GfJrPzrGpUrak8Qp5xcwCqQ)
statusstringThe status of the encryption key. You can use only an ACTIVE key to encrypt tokens issued by the authorization server. (example: ACTIVE, default: ACTIVE)
usestringAcceptable use of the JSON Web Key (example: enc)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_oauth2_resource_server_json_web_keysselectsubdomainLists all the public keys used by the custom authorization server
get_oauth2_resource_server_json_web_keyselectsubdomainRetrieves a custom authorization server public JSON web key by key id
add_oauth2_resource_server_json_web_keyinsertsubdomainAdds a new JSON Web Key to the custom authorization servers JSON web keys.<br />&gt; **Note:** This API doesn't allow you to add a key if the existing key doesn't have a kid. Use the [Replace an Authorization Server](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/AuthorizationServer/#tag/AuthorizationServer/operation/replaceAuthorizationServer) operation to update the JWKS or [Delete a Custom Authorization Server Public JSON Web Key](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/OAuth2ResourceServerCredentialsKeys/#tag/OAuth2ResourceServerCredentialsKeys/operation/deleteOAuth2ResourceServerJsonWebKey) and re-add the key with a kid`.
> Note: This API doesn't allow you to add a key with an ACTIVE status. You need to add an INACTIVE key first, and then ACTIVATE the key.
delete_oauth2_resource_server_json_web_keydeletesubdomainDeletes a custom authorization server public JSON web key by key id. You can only delete an inactive key.
activate_oauth2_resource_server_json_web_keyexecsubdomainActivates a custom authorization server public JSON web key by key id.
> Note: You can have only one active key at any given time for the authorization server. When you activate an inactive key, Okta automatically deactivates the current active key.
deactivate_oauth2_resource_server_json_web_keyexecsubdomainDeactivates a custom authorization server public JSON web key by key id.
> Note: Deactivating the active key isn't allowed if the authorization server has access token encryption enabled. You can activate another key, which makes the current key inactive.

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 the public keys used by the custom authorization server

SELECT
id,
_links,
created,
e,
kid,
kty,
lastUpdated,
n,
status,
use
FROM okta.authorizationservers.oauth2_resource_server_jwks
WHERE subdomain = '{{ subdomain }}' -- required;

INSERT examples

Adds a new JSON Web Key to the custom authorization servers JSON web keys.<br />&gt; **Note:** This API doesn't allow you to add a key if the existing key doesn't have a kid. Use the [Replace an Authorization Server](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/AuthorizationServer/#tag/AuthorizationServer/operation/replaceAuthorizationServer) operation to update the JWKS or [Delete a Custom Authorization Server Public JSON Web Key](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/OAuth2ResourceServerCredentialsKeys/#tag/OAuth2ResourceServerCredentialsKeys/operation/deleteOAuth2ResourceServerJsonWebKey) and re-add the key with a kid`.
> Note: This API doesn't allow you to add a key with an ACTIVE status. You need to add an INACTIVE key first, and then ACTIVATE the key.

INSERT INTO okta.authorizationservers.oauth2_resource_server_jwks (
data__e,
data__kid,
data__kty,
data__n,
data__status,
data__use,
subdomain
)
SELECT
'{{ e }}',
'{{ kid }}',
'{{ kty }}',
'{{ n }}',
'{{ status }}',
'{{ use }}',
'{{ subdomain }}'
RETURNING
id,
_links,
created,
e,
kid,
kty,
lastUpdated,
n,
status,
use
;

DELETE examples

Deletes a custom authorization server public JSON web key by key id. You can only delete an inactive key.

DELETE FROM okta.authorizationservers.oauth2_resource_server_jwks
WHERE subdomain = '{{ subdomain }}' --required;

Lifecycle Methods

Activates a custom authorization server public JSON web key by key id.
> Note: You can have only one active key at any given time for the authorization server. When you activate an inactive key, Okta automatically deactivates the current active key.

EXEC okta.authorizationservers.oauth2_resource_server_jwks.activate_oauth2_resource_server_json_web_key 
@subdomain='{{ subdomain }}' --required;