Skip to content

JWT Claims

{
"iss": "https://auth.beshoy.ai",
"sub": "usr_abc123",
"aud": "proj_gym",
"email": "user@example.com",
"email_verified": true,
"role": "admin",
"status": "active",
"iat": 1716000000,
"exp": 1716000300
}
ClaimTypeDescription
issstringAlways "https://auth.beshoy.ai"
substringUser ID (usr_ prefixed)
audstringProject ID this token was issued for
emailstringUser’s email address
email_verifiedbooleanWhether email has been verified
rolestringUser’s role in the project ("admin" or "member")
statusstringUser’s status ("active" or "blocked")
iatnumberIssued at (Unix timestamp)
expnumberExpires at (Unix timestamp, iat + 300)
{
"iss": "https://auth.beshoy.ai",
"sub": "anon",
"aud": "proj_trip",
"role": "pin_member",
"pin_id": "pin_xyz789",
"privileges": ["view", "edit", "date-spots"],
"iat": 1716000000,
"exp": 1716000300
}
ClaimTypeDescription
substringAlways "anon" for PIN sessions
rolestringAlways "pin_member"
pin_idstringID of the PIN used to authenticate
privilegesstring[]Privileges assigned to this PIN
{
"iss": "https://auth.beshoy.ai",
"sub": "usr_abc123",
"aud": "cloudflare_sso",
"email": "me@beshoy.eu",
"email_verified": true,
"iat": 1716000000,
"exp": 1716000300
}

Signed with ES256 (P-256 ECDSA) instead of HS256. Public key available at /.well-known/jwks.json.

Token TypeAlgorithmKey
Access tokenHS256Per-project signing_key (256-bit)
PIN tokenHS256Same per-project signing_key
OIDC ID tokenES256Single EC P-256 key pair
  • Tokens are project-scoped. A token for proj_gym cannot be verified with proj_trip’s signing key.
  • Status is embedded. Check it on every request — don’t assume “active” from a previous check.
  • No Hasura claims. Unlike some setups, there are no x-hasura-* claims in the JWT. Hasura integration happens via the proxy pattern with admin-secret headers.
  • 5-minute lifetime. Access tokens expire quickly. Always implement refresh logic.