JWS (JSON Web Signature)
JWS (JSON Web Signature) is the signed token format defined in RFC 7515. A compact JWS serializes as base64url(header).base64url(payload).signature. It provides integrity and authenticity but not confidentiality — the payload is readable. Most JWTs in the wild are JWS tokens with typ JWT. JWS supports multiple serialization formats, but compact is standard for HTTP authentication. Implementations across Node.js, Python, Go, Ruby, and Java follow the same RFC standards, so concepts transfer directly between stacks. Security reviews should treat this as part of your full authentication threat model, not an isolated configuration detail. Document expected behavior for client teams so tokens are issued, stored, and validated consistently across services.
Why It Matters
Understanding JWS clarifies that JWT does not imply encryption. Security teams often assume tokens are opaque; developers must know payloads are public. Choose JWS for signed access tokens; choose JWE when claims themselves must be confidential. Getting this wrong often surfaces only after an incident, when forged or replayed tokens expose gaps in validation or secret handling. Platform teams should encode these rules in libraries, linting, and deployment checklists so individual services cannot drift silently. Pair technical controls with monitoring: log verification failures, track unusual token lifetimes, and alert on spikes in 401 responses. Review this during every auth-related change, including framework upgrades, CDN additions, and new mobile or third-party clients.
Related Terms
Related Comparisons
Related Tools
Related Articles
Frequently Asked Questions
Is every JWT a JWS?
Most are, but JWT can also be a JWE (encrypted). Check the header for alg and enc fields. Consult your JWT library documentation for exact option names, defaults, and error types. When in doubt, prefer stricter validation and shorter token lifetimes over permissive shortcuts.
Does JWS hide the payload?
No. Only JWE encrypts payload content. JWS protects against tampering, not disclosure. Consult your JWT library documentation for exact option names, defaults, and error types. When in doubt, prefer stricter validation and shorter token lifetimes over permissive shortcuts. Test edge cases with expired, malformed, and wrong-algorithm tokens in CI before shipping auth changes.
What algorithms can JWS use?
HS256, RS256, ES256, PS256, and others registered in IANA JOSE algorithms. Consult your JWT library documentation for exact option names, defaults, and error types. When in doubt, prefer stricter validation and shorter token lifetimes over permissive shortcuts. Test edge cases with expired, malformed, and wrong-algorithm tokens in CI before shipping auth changes.