Skip to main content
Sign Testing JWT
Signs a short-lived JWT (5 minutes) using your project’s RSA private key. Use this during development to generate tokens for testing external auth without needing to implement JWT signing in your test environment.
Never use this endpoint in production. It requires your RSA private key in the request body, which must be kept secret. Use it only in local development or CI environments.

Body Parameters

string
required
Your RSA private key encoded as a Base64 string. This is the private key associated with the public key configured in your project’s external auth settings.
object
required
The JWT payload. Must include at least an id field (the user’s ID in your system). All fields are included in the userData claim.
The project is the one in the URL path (/v8/:projectId/...); the token’s iss is set from it. Don’t send projectId in the body or the query string: either returns 400 project/wrong-location.

Response

Returns the signed JWT as a plain text string (not JSON):
The JWT is signed with RS256, expires in 5 minutes, and includes:
  • sub — the user’s id from the payload
  • iss — the project ID from the URL path
  • aud — "sublay.io"
  • userData — the full payload object

Error Responses

Returned when privateKey or payload is missing.
Returned when the request sends projectId in the body or the query string, or sends an x-sublay-project-id header.
Returned when the payload object does not include an id field.