Standards — JWT

Standards

JSON Web Token (JWT, RFC 7519) is a compact, URL-safe format for representing claims that are transferred between two parties. A JWT is a JSON object whose integrity (and optionally confidentiality) is protected using the JOSE (JSON Object Signing and Encryption) suite of standards: JSON Web Signature (JWS, RFC 7515) for signing, JSON Web Encryption (JWE, RFC 7516) for encryption, JSON Web Key (JWK, RFC 7517) for key representation, and JSON Web Algorithms (JWA, RFC 7518) for the cryptographic algorithms involved. Quasr issues signed JWTs (JWS) as identity and access tokens for both OAuth 2.0 and OpenID Connect.

Structure

A signed JWT (JWS Compact Serialization) consists of three base64url-encoded segments separated by dots: header.payload.signature.

  • Header — declares the token type (typ: JWT) and the signing algorithm (alg), plus the key identifier (kid) used to select the verification key.
  • Payload — the claim set. Registered claims include iss (issuer), sub (subject), aud (audience), exp (expiry), iat (issued at), nbf (not before) and jti (unique token ID). Public and private claims can be added on top for application-specific data.
  • Signature — computed over the header and payload using the algorithm in alg, allowing a verifier to detect tampering.

Architecture

JWTs decouple the party that issues a token from the parties that consume it. The issuer signs tokens with a private key; any number of consumers can verify them independently using the corresponding public key, without needing to call back to the issuer or share a shared secret. Quasr acts as the issuer: it signs tokens asymmetrically and publishes the current public keys as a JSON Web Key Set (JWKS) so that your APIs can verify tokens locally.

Security Considerations

  • Always verify the signature, and always pin the expected alg — never derive it from the token itself. This prevents algorithm-confusion attacks (e.g. an attacker presenting an HMAC-signed token verified against an RSA public key, or a token using alg: none).
  • Validate iss, aud and exp (and nbf if present) on every verification — a syntactically valid signature is not sufficient on its own.
  • Keep access tokens short-lived and rely on refresh tokens (see OAuth) for renewal, rather than issuing long-lived JWTs that cannot be revoked before they expire.
  • Use a well-vetted JOSE/JWT library for your platform rather than hand-rolling verification logic — subtle mistakes here are a recurring source of authentication bypasses.

Resources

2026.11.22 | © Copyright 2026 Quasr BV