Skip to content
Esc
navigateopen⌘Jpreview
Dashboard

Create signed JWT

Create a signed JWT

POST/appid-{appId}/recipe/jwt
Authorization
api-keyAPI key · headerrequired
The core service API token. If you are using a self-hosted core service and you have not generated a token, you can omit the header.
Header parameters
ridstring
cdi-versionstring
X.Y of the X.Y.Z CDI version.
Request body
application/json
payloadcreateJWTPayload
The payload of the JWT, should be a JSON object.
algorithmcreateJWTAlgorithm
The algorithm to use when creating the JWT.
Allowed:RS256
jwksDomainjwksDomain
This is used as the value for the issuer claim in the JWT payload.
validityjwtValidity
Duration in seconds, used to calculate JWT expiry
useStaticSigningKeyboolean
Decides if the token should be signed with a dynamic or static key, defaults to true
Responses
200Create a signed JWT
One of:
object
statusstatusOK
Allowed:OK
jwtstring
object
statusstring
Allowed:UNSUPPORTED_ALGORITHM_ERROR
400error code 400
string
404error code 404
string
500error code 500
string
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST "/appid-{appId}/recipe/jwt" \
  -H "api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "payload": {
    "custom-claim": ""
  },
  "algorithm": "RS256",
  "jwksDomain": "https://api.test.com/",
  "validity": 86400,
  "useStaticSigningKey": true
}'
Response
{
  "status": "OK",
  "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}

API reference

API schema and response details