Skip to main content

jwks

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

Overview​

Namejwks
TypeResource
Idokta.apps.jwks

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe unique ID of the OAuth client JSON Web Key (example: pks2f4zrZbs8nUa7p0g4)
_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.
createdstringTimestamp when the OAuth 2.0 client 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 OAUth 2.0 client's JWKS (example: SIMcCQNY3uwXoW3y0vf6VxiBb5n9pf8L2fK8d-FIbm4)
ktystringCryptographic algorithm family for the certificate's key pair (RSA) (example: RSA)
lastUpdatedstringTimestamp when the OAuth 2.0 client 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)
statusstringStatus of the OAuth 2.0 client JSON Web Key (ACTIVE, INACTIVE) (example: ACTIVE, default: ACTIVE)
usestringAcceptable use of the JSON Web Key (enc) (example: enc)
xstringThe public x coordinate for the elliptic curve point
ystringThe public y coordinate for the elliptic curve point

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_jwkselectappId, keyId, subdomainRetrieves an OAuth 2.0 client JSON Web Key by keyId
list_jwkselectappId, subdomainLists all JSON Web Keys for an OAuth 2.0 client app
add_jwkinsertappId, subdomainAdds a new JSON Web Key to the clients JSON Web Keys.<br />> **Note:** This API doesn't allow you to add a key if the existing key doesn't have a kid. This is also consistent with how the [Dynamic Client Registration](https://developer.okta.com/docs/api/openapi/okta-oauth/oauth/client) or [Applications](https://developer.okta.com/docs/api/openapi/okta-management/management/tags/application) APIs behave, as they don't allow the creation of multiple keys without kids. Use the [Replace an Application](https://developer.okta.com/docs/api/openapi/okta-management/management/application/replaceapplication) or the [Replace a Client Application](https://developer.okta.com/docs/api/openapi/okta-oauth/oauth/client/replaceclient) operation to update the JWKS or [Delete an OAuth 2.0 Client JSON Web Key](https://developer.okta.com/docs/api/openapi/okta-management/management/applicationssopublickeys/deletejwk) and re-add the key with a kid`.
deletejwkdeleteappId, keyId, subdomainDeletes an OAuth 2.0 Client JSON Web Key by keyId. You can only delete an inactive key.
activate_oauth2_client_json_web_keyexecappId, keyId, subdomainActivates an OAuth 2.0 client JSON Web Key by keyId
> Note: You can have only one active encryption key at any given time for an app. When you activate an inactive key, the current active key is automatically deactivated.
deactivate_oauth2_client_json_web_keyexecappId, keyId, subdomainDeactivates an OAuth 2.0 client JSON Web Key by keyId
> Note: You can only deactivate signing keys. Deactivating the active encryption key isn't allowed if the client has ID token encryption enabled. You can activate another encryption 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
appIdstringApplication ID
keyIdstringUnique id of the OAuth 2.0 client JSON Web Key (example: pks2f4zrZbs8nUa7p0g4)
subdomainstring(default: my-org)

SELECT examples​

Retrieves an OAuth 2.0 client JSON Web Key by keyId

SELECT
id,
_links,
created,
e,
kid,
kty,
lastUpdated,
n,
status,
use,
x,
y
FROM okta.apps.jwks
WHERE appId = '{{ appId }}' -- required
AND keyId = '{{ keyId }}' -- required
AND subdomain = '{{ subdomain }}' -- required
;

INSERT examples​

Adds a new JSON Web Key to the clients JSON Web Keys.<br />> **Note:** This API doesn't allow you to add a key if the existing key doesn't have a kid. This is also consistent with how the [Dynamic Client Registration](https://developer.okta.com/docs/api/openapi/okta-oauth/oauth/client) or [Applications](https://developer.okta.com/docs/api/openapi/okta-management/management/tags/application) APIs behave, as they don't allow the creation of multiple keys without kids. Use the [Replace an Application](https://developer.okta.com/docs/api/openapi/okta-management/management/application/replaceapplication) or the [Replace a Client Application](https://developer.okta.com/docs/api/openapi/okta-oauth/oauth/client/replaceclient) operation to update the JWKS or [Delete an OAuth 2.0 Client JSON Web Key](https://developer.okta.com/docs/api/openapi/okta-management/management/applicationssopublickeys/deletejwk) and re-add the key with a kid`.

INSERT INTO okta.apps.jwks (
alg,
use,
e,
kty,
n,
kid,
status,
x,
y,
appId,
subdomain
)
SELECT
'{{ alg }}',
'{{ use }}',
'{{ e }}',
'{{ kty }}',
'{{ n }}',
'{{ kid }}',
'{{ status }}',
'{{ x }}',
'{{ y }}',
'{{ appId }}',
'{{ subdomain }}'
RETURNING
id,
_links,
created,
e,
kid,
kty,
lastUpdated,
n,
status,
use,
x,
y
;

DELETE examples​

Deletes an OAuth 2.0 Client JSON Web Key by keyId. You can only delete an inactive key.

DELETE FROM okta.apps.jwks
WHERE appId = '{{ appId }}' --required
AND keyId = '{{ keyId }}' --required
AND subdomain = '{{ subdomain }}' --required
;

Lifecycle Methods​

Activates an OAuth 2.0 client JSON Web Key by keyId
> Note: You can have only one active encryption key at any given time for an app. When you activate an inactive key, the current active key is automatically deactivated.

EXEC okta.apps.jwks.activate_oauth2_client_json_web_key
@appId='{{ appId }}' --required,
@keyId='{{ keyId }}' --required,
@subdomain='{{ subdomain }}' --required
;