Skip to content

JWT Payload

Cognito issues two types of JWT tokens: an Identity Token (used to identify the user) and an Access Token (used to authorize API access). This document describes their claim structures.

Note: This document reflects the intended token structure while Cognito integration is in progress. Confirm all claims against live system behavior.

The Identity Token identifies the user and includes custom attributes.

ClaimDescription
subUnique user ID in the User Pool
emailUser’s email address
email_verifiedWhether the email has been verified
cognito:usernameInternal Cognito username
custom:tenantTenant ID: <tenant-name>::<tenant-uuid>
custom:roleUser role: public, lite, subscriber, admin, or system
audClient ID (audience)
issIssuer URL: https://cognito-idp.<region>.amazonaws.com/<user-pool-id>
expExpiry timestamp
iatIssued-at timestamp
auth_timeAuthentication timestamp
identitiesFederated identity metadata (e.g., Google SSO)
{
"sub": "248289dc-...-f2f44a",
"email_verified": true,
"name": "Jane Doe",
"email": "jane@example.com",
"custom:tenant": "acme-corp::1fa48bf2-3ef9-4d08-8858-29e71504a1ed",
"custom:role": "subscriber",
"cognito:username": "janedoe",
"aud": "client-app-id",
"iss": "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_ABC123",
"exp": 1712608972,
"iat": 1712605372,
"auth_time": 1712605370
}

The Access Token authorizes calls to protected API endpoints. It does not include user profile attributes by default.

ClaimDescription
token_use"access" — identifies the token type
scopeSpace-separated OAuth2 scopes granted
client_idApp client that requested the token
usernameCognito username
issIssuer URL
exp, iatExpiry and issued-at timestamps
jtiUnique token identifier
{
"sub": "248289dc-...-f2f44a",
"token_use": "access",
"scope": "openid profile email aws.cognito.signin.user.admin",
"auth_time": 1712605372,
"iss": "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_ABC123",
"exp": 1712608972,
"iat": 1712605372,
"jti": "token-id",
"client_id": "client-app-id",
"username": "janedoe"
}

Cognito custom attributes support only string values (max 2048 characters). JSON objects, arrays, and nested structures are not allowed. Multi-valued attributes must be encoded as delimited strings.