Skip to content
Kapten
Esc
↑↓navigate↵open⌘Jpreview

Register a public key

Registers a public key the application signs its token requests with (private_key_jwt), for example to rotate keys. Requires organization:update. A key already registered for the application, even revoked, is refused (409), as are more than 5 active keys.

POST/organizations/{organizationId}/oauth-clients/{clientId}/keys
Authorization
AuthorizationBearer token (JWT) · headerrequired

An access token issued by this service (RFC 9068), in the Authorization header as Bearer <token>.

Path parameters
organizationIdstring<uuid>required
clientIdstring<uuid>required

The client's id, the uuid in its cli_<id> client_id.

Request body
requiredapplication/json
jwkpublic_jwkrequired

A public signing key (RFC 7517) - EC P-256, P-384 or P-521, Ed25519 (OKP), or RSA of 2048 bits or more. Private members are refused; use, when present, must be sig.

Responses
201

The registered key.

idstring<uuid>required
kidstringrequired

The key's RFC 7638 SHA-256 thumbprint. Client assertions may name the key by it, or by the jwk's own kid, in their kid header.

jwkpublic_jwkrequired

A public signing key (RFC 7517) - EC P-256, P-384 or P-521, Ed25519 (OKP), or RSA of 2048 bits or more. Private members are refused; use, when present, must be sig.

created_atstring<date-time>required
revoked_atstring<date-time>

Set once the key is revoked; assertions it signs are refused.

default

The request failed.

errorstringrequired

Stable machine-readable code.

Allowed:invalid_requestunauthorizedforbiddennot_foundconflictgoneunavailableinternal
messagestringrequired

Human-readable explanation.

Request
curl -X POST 'https://auth.kapten.io/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/oauth-clients/497f6eca-6276-4993-bfeb-53cbbbba6f08/keys' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "jwk": {}
}'
Response
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "kid": "string",
  "jwk": {},
  "created_at": "2019-08-24T14:15:22Z",
  "revoked_at": "2019-08-24T14:15:22Z"
}

Was this page helpful?