POST /api/configs/jwt-customizer/test

Test the JWT customizer script with the given sample context and sample token payload.

application/json

Body object Required

One of:

Responses

  • 200 application/json

    The result of the JWT customizer script testing.

    arbitrary

  • 400

    Zod errors in cloud service (data type does not match expectation, can be either request body or response body).

  • 401

    Unauthorized

  • 403

    Cloud connection does not have enough permission to perform the action.

  • 422

    Syntax errors in cloud service.

POST /api/configs/jwt-customizer/test
curl \
 --request POST 'https://[tenant_id].logto.app/api/configs/jwt-customizer/test' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"payload":{},"environmentVariables":{"additionalProperty1":"string","additionalProperty2":"string"},"script":"string","token":{"jti":"string","aud":"string","scope":"string","clientId":"string","accountId":"string","expiresWithSession":true,"grantId":"string","gty":"string","sessionUid":"string","sid":"string","kind":"string"},"context":{"user":{"id":"string","username":"string","primaryEmail":"string","primaryPhone":"string","name":"string","avatar":"string","customData":{},"identities":{"additionalProperty1":{"userId":"string","details":{}},"additionalProperty2":{"userId":"string","details":{}}},"lastSignInAt":42.0,"createdAt":42.0,"updatedAt":42.0,"profile":{"familyName":"string","givenName":"string","middleName":"string","nickname":"string","preferredUsername":"string","profile":"string","website":"string","gender":"string","birthdate":"string","zoneinfo":"string","locale":"string","address":{"formatted":"string","streetAddress":"string","locality":"string","region":"string","postalCode":"string","country":"string"}},"applicationId":"string","isSuspended":true,"hasPassword":true,"ssoIdentities":[{"issuer":"string","identityId":"string","detail":{}}],"mfaVerificationFactors":["Totp"],"roles":[{"id":"string","name":"string","description":"string","scopes":[{"id":"string","name":"string","description":"string","resourceId":"string","resource":{"tenantId":"string","id":"string","name":"string","indicator":"string","isDefault":true,"accessTokenTtl":42.0}}]}],"organizations":[{"id":"string","name":"string","description":"string"}],"organizationRoles":[{"organizationId":"string","roleId":"string","roleName":"string"}]},"grant":{"type":"string","subjectTokenContext":{}},"interaction":{"interactionEvent":"SignIn","userId":"string","verificationRecords":[{"id":"string","type":"string","identifier":{"type":"username","value":"string"},"verified":true}],"signInContext":{"additionalProperty1":"string","additionalProperty2":"string"}},"application":{"tenantId":"string","id":"string","name":"string","description":"string","type":"Native","oidcClientMetadata":{"redirectUris":[{}],"postLogoutRedirectUris":[{}],"backchannelLogoutUri":"string","backchannelLogoutSessionRequired":true,"logoUri":"string"},"customClientMetadata":{"corsAllowedOrigins":["string"],"idTokenTtl":42.0,"refreshTokenTtl":42.0,"refreshTokenTtlInDays":42.0,"tenantId":"string","alwaysIssueRefreshToken":true,"rotateRefreshToken":true,"allowTokenExchange":true},"protectedAppMetadata":{"host":"string","origin":"string","sessionDuration":42.0,"pageRules":[{"path":"string"}],"customDomains":[{"domain":"string","status":"PendingVerification","errorMessage":"string","dnsRecords":[{"name":"string","type":"string","value":"string"}],"cloudflareData":{"id":"string","status":"string","ssl":{"status":"string","validation_errors":[{"message":"string"}]},"verification_errors":["string"]}}]},"customData":{},"isThirdParty":true,"createdAt":42.0}}}'
Request examples
{
  "payload": {},
  "environmentVariables": {
    "additionalProperty1": "string",
    "additionalProperty2": "string"
  },
  "script": "string",
  "token": {
    "jti": "string",
    "aud": "string",
    "scope": "string",
    "clientId": "string",
    "accountId": "string",
    "expiresWithSession": true,
    "grantId": "string",
    "gty": "string",
    "sessionUid": "string",
    "sid": "string",
    "kind": "string"
  },
  "context": {
    "user": {
      "id": "string",
      "username": "string",
      "primaryEmail": "string",
      "primaryPhone": "string",
      "name": "string",
      "avatar": "string",
      "customData": {},
      "identities": {
        "additionalProperty1": {
          "userId": "string",
          "details": {}
        },
        "additionalProperty2": {
          "userId": "string",
          "details": {}
        }
      },
      "lastSignInAt": 42.0,
      "createdAt": 42.0,
      "updatedAt": 42.0,
      "profile": {
        "familyName": "string",
        "givenName": "string",
        "middleName": "string",
        "nickname": "string",
        "preferredUsername": "string",
        "profile": "string",
        "website": "string",
        "gender": "string",
        "birthdate": "string",
        "zoneinfo": "string",
        "locale": "string",
        "address": {
          "formatted": "string",
          "streetAddress": "string",
          "locality": "string",
          "region": "string",
          "postalCode": "string",
          "country": "string"
        }
      },
      "applicationId": "string",
      "isSuspended": true,
      "hasPassword": true,
      "ssoIdentities": [
        {
          "issuer": "string",
          "identityId": "string",
          "detail": {}
        }
      ],
      "mfaVerificationFactors": [
        "Totp"
      ],
      "roles": [
        {
          "id": "string",
          "name": "string",
          "description": "string",
          "scopes": [
            {
              "id": "string",
              "name": "string",
              "description": "string",
              "resourceId": "string",
              "resource": {
                "tenantId": "string",
                "id": "string",
                "name": "string",
                "indicator": "string",
                "isDefault": true,
                "accessTokenTtl": 42.0
              }
            }
          ]
        }
      ],
      "organizations": [
        {
          "id": "string",
          "name": "string",
          "description": "string"
        }
      ],
      "organizationRoles": [
        {
          "organizationId": "string",
          "roleId": "string",
          "roleName": "string"
        }
      ]
    },
    "grant": {
      "type": "string",
      "subjectTokenContext": {}
    },
    "interaction": {
      "interactionEvent": "SignIn",
      "userId": "string",
      "verificationRecords": [
        {
          "id": "string",
          "type": "string",
          "identifier": {
            "type": "username",
            "value": "string"
          },
          "verified": true
        }
      ],
      "signInContext": {
        "additionalProperty1": "string",
        "additionalProperty2": "string"
      }
    },
    "application": {
      "tenantId": "string",
      "id": "string",
      "name": "string",
      "description": "string",
      "type": "Native",
      "oidcClientMetadata": {
        "redirectUris": [
          {}
        ],
        "postLogoutRedirectUris": [
          {}
        ],
        "backchannelLogoutUri": "string",
        "backchannelLogoutSessionRequired": true,
        "logoUri": "string"
      },
      "customClientMetadata": {
        "corsAllowedOrigins": [
          "string"
        ],
        "idTokenTtl": 42.0,
        "refreshTokenTtl": 42.0,
        "refreshTokenTtlInDays": 42.0,
        "tenantId": "string",
        "alwaysIssueRefreshToken": true,
        "rotateRefreshToken": true,
        "allowTokenExchange": true
      },
      "protectedAppMetadata": {
        "host": "string",
        "origin": "string",
        "sessionDuration": 42.0,
        "pageRules": [
          {
            "path": "string"
          }
        ],
        "customDomains": [
          {
            "domain": "string",
            "status": "PendingVerification",
            "errorMessage": "string",
            "dnsRecords": [
              {
                "name": "string",
                "type": "string",
                "value": "string"
              }
            ],
            "cloudflareData": {
              "id": "string",
              "status": "string",
              "ssl": {
                "status": "string",
                "validation_errors": [
                  {
                    "message": "string"
                  }
                ]
              },
              "verification_errors": [
                "string"
              ]
            }
          }
        ]
      },
      "customData": {},
      "isThirdParty": true,
      "createdAt": 42.0
    }
  }
}
{
  "payload": {},
  "environmentVariables": {
    "additionalProperty1": "string",
    "additionalProperty2": "string"
  },
  "script": "string",
  "token": {
    "jti": "string",
    "aud": "string",
    "scope": "string",
    "clientId": "string",
    "kind": "string"
  },
  "context": {
    "application": {
      "tenantId": "string",
      "id": "string",
      "name": "string",
      "description": "string",
      "type": "Native",
      "oidcClientMetadata": {
        "redirectUris": [
          {}
        ],
        "postLogoutRedirectUris": [
          {}
        ],
        "backchannelLogoutUri": "string",
        "backchannelLogoutSessionRequired": true,
        "logoUri": "string"
      },
      "customClientMetadata": {
        "corsAllowedOrigins": [
          "string"
        ],
        "idTokenTtl": 42.0,
        "refreshTokenTtl": 42.0,
        "refreshTokenTtlInDays": 42.0,
        "tenantId": "string",
        "alwaysIssueRefreshToken": true,
        "rotateRefreshToken": true,
        "allowTokenExchange": true
      },
      "protectedAppMetadata": {
        "host": "string",
        "origin": "string",
        "sessionDuration": 42.0,
        "pageRules": [
          {
            "path": "string"
          }
        ],
        "customDomains": [
          {
            "domain": "string",
            "status": "PendingVerification",
            "errorMessage": "string",
            "dnsRecords": [
              {
                "name": "string",
                "type": "string",
                "value": "string"
              }
            ],
            "cloudflareData": {
              "id": "string",
              "status": "string",
              "ssl": {
                "status": "string",
                "validation_errors": [
                  {
                    "message": "string"
                  }
                ]
              },
              "verification_errors": [
                "string"
              ]
            }
          }
        ]
      },
      "customData": {},
      "isThirdParty": true,
      "createdAt": 42.0
    }
  }
}
Response examples (200)
{}