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.
A signed JWT (JWS Compact Serialization) consists of three base64url-encoded segments separated by dots: header.payload.signature.
typ: JWT) and the signing algorithm (alg), plus the key identifier (kid) used to select the verification key.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.alg, allowing a verifier to detect tampering.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.
https://{tenant_id}.api.quasr.io/.well-known/jwks.json. Keys are referenced by kid so they can be rotated without downtime — always select the verification key by matching kid rather than assuming a single fixed key.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).iss, aud and exp (and nbf if present) on every verification — a syntactically valid signature is not sufficient on its own.iss to your tenant-specific issuer URL, https://{tenant_id}.api.quasr.io — validate against this exact value rather than a generic Quasr domain.aud on tokens issued for your resource server to your own resource server, not leave it as Quasr's own API audience (https://api.quasr.io). Cleanly separating audiences this way is what actually closes the substitution attack described below: none of Quasr's other internal tokens (ID tokens, refresh tokens, consent tokens, tokens scoped to Quasr's own API, etc.) carry your resource server's audience, so they simply won't pass an aud check against it, regardless of any other claim.aud alone — but as defense in depth it's recommended to also check the https://api.quasr.io/claims/typ claim matches the exact token type you expect (most likely oauth2:access). Quasr encrypts most of these tokens (JWE) as a further mitigation.