Authentication
Login Response JSON Example
A JSON example for a successful authentication response — access token, refresh token, expiry, and the authenticated user's basic profile. Copy-ready for REST and OAuth-style login endpoints.
Field Reference
accessTokenrequiredstringShort-lived JWT used to authenticate subsequent API requests, sent as Authorization: Bearer <token>refreshTokenrequiredstringLong-lived opaque token used to obtain a new access token without re-entering credentialstokenTyperequiredstringAlways 'Bearer' for token-based auth — indicates how the client should send accessTokenexpiresInrequirednumberSeconds until accessToken expires, from issuedAtuserrequiredobjectMinimal authenticated-user payload — avoid including sensitive fields heresessionIdoptionalstringServer-side session identifier, useful for session revocation and audit logsVariants
MinimalThe smallest valid login response — just the token needed to authenticate.
MFA RequiredReturned instead of tokens when the account has two-factor authentication enabled — the client must complete a second step.
Common Use Cases
- →Designing the response body for a POST /auth/login endpoint
- →Implementing token refresh logic on the client using accessToken + refreshToken
- →Building a mock authentication server for frontend development before the real backend exists
loginauthenticationaccess tokenrefresh tokensession
Validate or format this JSON
One click loads this exact example into the tool — no copy-paste needed. Format it, validate it, explore the tree, or generate TypeScript types instantly.
Frequently Asked Questions
Related JSON Examples
AuthenticationJWT PayloadJWT payload JSON with standard RFC 7519 claims and custom role/permission fields.API DesignUser ProfileStandard user profile JSON with personal info, address, and account metadata.API DesignREST API ResponseGeneric REST API response wrapper with data payload, status, and pagination meta.