OAuth, JSON Web Token (JWT) and tokens for testers
A token is like a hotel key card. Learn who hands it out, what it says, when it ends and which doors it opens. Then learn what a tester must never paste into a ticket.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: a hotel key card. The hotel checks who you are, then gives you a card for particular doors and a limited stay. The door still has to decide whether to accept it.
Daily List is a to-do list app. Lily wants it to read her calendar. The calendar service asks her to approve that access without giving Daily List her calendar password. Daily List receives a token, a credential for the allowed requests.
Tom asks who issued it, what access it grants, which service should accept it and when it stops being valid. These are separate questions: a real card for the wrong hotel should not open a door.
OAuth describes how access can be granted. A is one possible way to carry claims; not every OAuth token has that format. OpenID Connect adds a standard identity layer when the app also needs to verify who signed in.
The analogy has a limit. Tokens can expire and systems can support revocation or other checks that stop their use earlier. Logging out of one app does not by itself tell us what happened to every token.
Kept simple: Daily List, Lily, Tom and the calendar connection are fictional training examples. No real token is needed.
PLAIN WORDS · 2 in this section
- credential
- proof of who you are or what you may do
- revocation
- the act of officially withdrawing something given earlier
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.
THE REAL JOB Understanding who hands out a token, what it says, when it ends and which things it may do.
- Who issued it
- What it says
- When it ends
- What it opens
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| The hotel desk | The authorization server |
| The key card | The token |
| The doors the card opens | The token scope |
| The last day of the stay | The expiry time |
WHERE THIS PICTURE STOPS
- Tokens may expire, be revoked or become unusable under server policy; logout and revocation are not automatically the same operation.
- Signed compact JWS claims are readable; encrypted compact JWE and opaque access tokens need different handling.
- A hotel has one desk. OAuth has four roles.
HOOK
Who gave it, what it says, when it ends, what it opens.
REMEMBER IT THIS WAY
A contrast: two neighbours told apart by one test.
Issuer, expiry, audience, scope.
| In the trick | What it stands for |
|---|---|
| Issuer | The issuer required by the profile |
| Expiry | The expiry time |
| Audience | The intended recipient |
| Scope | The permitted operations |
TELL A FRIEND
A hotel key card. The desk checks you and gives a card that opens some doors, until a date.
OFTEN MIXED UP WITH API log-in and permissions. The earlier lesson covers refusals such as unauthorised and forbidden. This lesson reads the token itself and the flow that creates it.
Sources & standards — 9 sources
- Market practice
RFC 6749: The OAuth 2.0 Authorization Framework ↗ — Internet Engineering Task Force · October2012§1.1 roles,§2.3 client authentication,§3.3 scope and§4.1 original Figure3/code exchange; actual text read6 November2026.
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Request for Comments 6749, October 2012. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
V34 review, 6 November 2026: Actual§1.1 roles,§2.3 client authentication,§3.3 scope and§4.1 Figure3/code exchange read. Client credentials can use configured passwords or key-based methods. Current security updates are identified separately.
- Market practice
The OAuth 2.0 Authorization Framework: Bearer Token Usage (Request for Comments 6750) ↗ — IETF · October2012§1.2/§1.3 bearer semantics and§2.1 Authorization header; actual text read6 November2026.
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Request for Comments (RFC) 6750, October 2012. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
V34 review, 6 November 2026: Actual§1.2 bearer meaning,§1.3 overview and§2.1 Authorization request header read. Bearer possession does not require a separate proof-of-possession key; other token designs may bind the sender.
- Market practice
RFC 7519: JSON Web Token (JWT) ↗ — Internet Engineering Task Force · May2015§3 and§4.1 registered claims; base requirements versus application-profile requirements; actual text read6 November2026.
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Request for Comments 7519, May 2015. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
V34 review, 6 November 2026: Actual§3 overview and§4.1 registered claims through iat read. JWS/JWE/nesting differ; registered claims are not all mandatory in the base specification but profiles can require them.
- Market practice
RFC7515: JSON Web Signature (May2015) ↗ — IETF · May2015§3.1 three-part compact JWS; actual text read6 November2026.
Actual relevant RFC sections read from the official RFC Editor plain text for V34 Security analysis. The date and scope identify the edition; surrounding lessons distinguish framework definitions, token profiles and current security guidance. No live token was created or used.
- Market practice
RFC7516: JSON Web Encryption (May2015) ↗ — IETF · May2015§3.1 five-part compact JWE; actual text read6 November2026.
Actual relevant RFC sections read from the official RFC Editor plain text for V34 Security analysis. The date and scope identify the edition; surrounding lessons distinguish framework definitions, token profiles and current security guidance. No live token was created or used.
- Market practice
RFC 8725: JSON Web Token Best Current Practices ↗ — Internet Engineering Task Force · February2020 entire§3 best practices: algorithm/key policy, verification, issuer/audience and distinct token rules; actual text read6 November2026.
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Request for Comments 8725, February 2020 (BCP 225). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
V34 review, 6 November 2026: Actual entire§3 validation-practice subsections read: trusted algorithm/key policy, cryptographic checks, issuer/audience and distinct rules for token kinds. Unsigned-token policy is context-sensitive; the authenticated training profile rejects it.
- Market practiceBCP 240, January 2025
RFC 9700: Best Current Practice for OAuth 2.0 Security ↗ — IETF / OpenID Foundation · RFC9700 January2025§2.1–2.2,§2.4 and§4.7: PKCE, CSRF protection, redirects, grant guidance and sender constraints; actual sections read6 November2026.
Primary-source scope and access recorded in v12-ba-technical-audit-20261106.md. Advisory practice unless the cited instrument and its applicability establish a requirement.
V34 review, 6 November 2026: Actual RFC9700 January2025§2.1–2.2,§2.4 and§4.7 read for current OAuth security: public-client PKCE required, confidential recommended; CSRF binding conditions, redirect exception and modern grant guidance.
- Market practice
RFC7009: OAuth2.0 Token Revocation (August2013) ↗ — IETF · August2013 revocation requirements, response and implementation note: distinguish expiry/logout and self-contained/reference-token checks; actual sections read6 November2026.
Actual relevant RFC sections read from the official RFC Editor plain text for V34 Security analysis. The date and scope identify the edition; surrounding lessons distinguish framework definitions, token profiles and current security guidance. No live token was created or used.
- Market practiceOpenID ConnectCore 1.0 incorporatingerrata set 2,15December2023
OpenID ConnectCore 1.0 incorporatingerrata set 2,15December2023 ↗ — OpenID Foundation · Core1.0 incorporating errata set2,15December2023 abstract/introduction and§2 ID-token purpose; actual sections read6 November2026.
Primary text read6November2026; see domain audit for scope and limits.
V34 review, 6 November 2026: Actual OpenID Connect Core1.0 incorporating errata set2,15December2023 abstract/introduction and§2 ID-token purpose read. OpenID Connect adds identity/authentication to OAuth; ID-token and access-token purposes differ.
PRACTISE AND KEEP
Sources for this topic — 13 sources
- Market practice
RFC 6749: The OAuth 2.0 Authorization Framework ↗ — Internet Engineering Task Force · October2012§1.1 roles,§2.3 client authentication,§3.3 scope and§4.1 original Figure3/code exchange; actual text read6 November2026.
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Request for Comments 6749, October 2012. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
V34 review, 6 November 2026: Actual§1.1 roles,§2.3 client authentication,§3.3 scope and§4.1 Figure3/code exchange read. Client credentials can use configured passwords or key-based methods. Current security updates are identified separately.
- Market practice
RFC 7519: JSON Web Token (JWT) ↗ — Internet Engineering Task Force · May2015§3 and§4.1 registered claims; base requirements versus application-profile requirements; actual text read6 November2026.
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Request for Comments 7519, May 2015. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
V34 review, 6 November 2026: Actual§3 overview and§4.1 registered claims through iat read. JWS/JWE/nesting differ; registered claims are not all mandatory in the base specification but profiles can require them.
- Market practice
RFC 8725: JSON Web Token Best Current Practices ↗ — Internet Engineering Task Force · February2020 entire§3 best practices: algorithm/key policy, verification, issuer/audience and distinct token rules; actual text read6 November2026.
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Request for Comments 8725, February 2020 (BCP 225). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
V34 review, 6 November 2026: Actual entire§3 validation-practice subsections read: trusted algorithm/key policy, cryptographic checks, issuer/audience and distinct rules for token kinds. Unsigned-token policy is context-sensitive; the authenticated training profile rejects it.
- Market practice
OAuth 2.0 authentication vulnerabilities (PortSwigger Web Security Academy) ↗ — PortSwigger · The state value works like an anti-forgery token and redirect addresses should be matched exactly against a registered list (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
JSON Web Token for Java Cheat Sheet (Open Worldwide Application Security Project) ↗ — Open Worldwide Application Security Project · Common token weaknesses include token sidejacking and client-side storage (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
The OAuth 2.0 Authorization Framework: Bearer Token Usage (Request for Comments 6750) ↗ — IETF · October2012§1.2/§1.3 bearer semantics and§2.1 Authorization header; actual text read6 November2026.
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Request for Comments (RFC) 6750, October 2012. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
V34 review, 6 November 2026: Actual§1.2 bearer meaning,§1.3 overview and§2.1 Authorization request header read. Bearer possession does not require a separate proof-of-possession key; other token designs may bind the sender.
- Market practice
Multifactor Authentication Cheat Sheet (OWASP) ↗ — Open Worldwide Application Security Project · Guidance on testing and building multi-factor sign-in (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
8 November2026 bounded primary update: 8November2026 actual OWASPMFA Intro/factorindependence,OTPHandling/Storage,riskbasedauth and ResettingMFA selectedsections read. Context-specific lifecycle/recovery; no jurisdiction/compliance or fullpage claim.
- Market practice
What is OAuth 2 (Auth0) ↗ — Auth0 · RFC 6749 (already in registry) defines both grants. Auth0 'What is OAuth 2' (search excerpt, page not opened).
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
RFC7515: JSON Web Signature (May2015) ↗ — IETF · May2015§3.1 three-part compact JWS; actual text read6 November2026.
Actual relevant RFC sections read from the official RFC Editor plain text for V34 Security analysis. The date and scope identify the edition; surrounding lessons distinguish framework definitions, token profiles and current security guidance. No live token was created or used.
- Market practice
RFC7516: JSON Web Encryption (May2015) ↗ — IETF · May2015§3.1 five-part compact JWE; actual text read6 November2026.
Actual relevant RFC sections read from the official RFC Editor plain text for V34 Security analysis. The date and scope identify the edition; surrounding lessons distinguish framework definitions, token profiles and current security guidance. No live token was created or used.
- Market practiceBCP 240, January 2025
RFC 9700: Best Current Practice for OAuth 2.0 Security ↗ — IETF / OpenID Foundation · RFC9700 January2025§2.1–2.2,§2.4 and§4.7: PKCE, CSRF protection, redirects, grant guidance and sender constraints; actual sections read6 November2026.
Primary-source scope and access recorded in v12-ba-technical-audit-20261106.md. Advisory practice unless the cited instrument and its applicability establish a requirement.
V34 review, 6 November 2026: Actual RFC9700 January2025§2.1–2.2,§2.4 and§4.7 read for current OAuth security: public-client PKCE required, confidential recommended; CSRF binding conditions, redirect exception and modern grant guidance.
- Market practice
RFC7009: OAuth2.0 Token Revocation (August2013) ↗ — IETF · August2013 revocation requirements, response and implementation note: distinguish expiry/logout and self-contained/reference-token checks; actual sections read6 November2026.
Actual relevant RFC sections read from the official RFC Editor plain text for V34 Security analysis. The date and scope identify the edition; surrounding lessons distinguish framework definitions, token profiles and current security guidance. No live token was created or used.
- Market practiceOpenID ConnectCore 1.0 incorporatingerrata set 2,15December2023
OpenID ConnectCore 1.0 incorporatingerrata set 2,15December2023 ↗ — OpenID Foundation · Core1.0 incorporating errata set2,15December2023 abstract/introduction and§2 ID-token purpose; actual sections read6 November2026.
Primary text read6November2026; see domain audit for scope and limits.
V34 review, 6 November 2026: Actual OpenID Connect Core1.0 incorporating errata set2,15December2023 abstract/introduction and§2 ID-token purpose read. OpenID Connect adds identity/authentication to OAuth; ID-token and access-token purposes differ.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.