Skip to main content

OIDC/OAuth2 Claims

JWTForge supports standard JWT, OIDC, and OAuth2 claims, plus arbitrary custom claims.

In the structured JSON model, put claims under body:

{
"body": {
"sub": "user123",
"scope": "openid profile email",
"roles": ["admin", "user"]
}
}
POST /token
Request
{
"body": {
"sub": "user123",
"scope": "openid profile email",
"roles": [
"admin",
"user"
]
}
}
Response
No response yet
Decoded token
No token yet

In the legacy flat model, claims can still be passed at the top level:

{
"sub": "user123",
"scope": "openid profile email",
"roles": ["admin", "user"]
}
POST /token
Request
{
"body": {
"sub": "user123",
"tenant_id": "tenant-456",
"permissions": [
"read",
"write",
"delete"
],
"metadata": {
"department": "Engineering",
"level": "senior"
}
}
}
Response
No response yet
Decoded token
No token yet

JWTForge intentionally does not strictly validate standard claims. It is a testing tool, so malformed, unexpected, or custom values are allowed where possible.

Claim Reference

ClaimDescriptionDefaultExample
issIssuerWorker URL"https://jwtforge.workers.dev"
subSubject"user123""user123", "auth0|507f1f77bcf86cd799439011"
audAudience"https://api.example.com""https://api.example.com", "my-resource-id"
expExpiration timeCurrent time + 1 hour1735689600
nbfNot beforeCurrent time1735686000
iatIssued atCurrent time1735686000
jtiJWT IDRandom UUID"550e8400-e29b-41d4-a716-446655440000"
client_idOAuth2 client identifierAuto-generated or user-provided"test_app", "client_a1b2c3d4"
nameFull namenone"John Doe"
given_nameFirst namenone"John"
family_nameLast namenone"Doe"
middle_nameMiddle namenone"Michael"
nicknameNicknamenone"Johnny"
preferred_usernamePreferred usernamenone"johndoe"
profileProfile page URLnone"https://example.com/users/johndoe"
picturePicture URLnone"https://example.com/avatar.jpg"
websiteWebsite URLnone"https://johndoe.com"
emailEmail addressnone"john@example.com"
email_verifiedEmail verification statusnonetrue, false
genderGendernone"male", "female", "other"
birthdateBirthdatenone"1990-01-15"
zoneinfoTime zonenone"America/New_York"
localeLocalenone"en-US", "fr-CA"
phone_numberPhone numbernone"+1-555-555-5555"
phone_number_verifiedPhone verification statusnonetrue, false
addressAddress objectnone{"street_address":"123 Main St","locality":"City","region":"State","postal_code":"12345","country":"US"}
updated_atLast update timestampnone1735686000
scopeOAuth2 scopesnone"openid profile email", "read write"
rolesUser rolesnone["admin", "user"]
groupsUser groupsnone["engineering", "management"]
nonceNonce for ID tokensnone"random-nonce-12345"

You can override any default claim or add custom claims in the request body.

Custom Claims

Custom claims are preserved in the JWT payload:

{
"body": {
"sub": "user123",
"tenant_id": "tenant-456",
"permissions": ["read", "write", "delete"],
"metadata": {
"department": "Engineering",
"level": "senior"
}
}
}

Operational Fields Are Not Claims

These fields configure token generation and are not emitted as payload claims:

  • mode
  • exclude
  • kty
  • response_type
  • grammar_category
  • malicious_category
  • vulnerability
  • header
  • signature

Keep operational fields at the top level and payload claims under body when using structured JSON.