Pcornel
Browse topics
Options
Recent
Favorites
Security · Technical reference

Tokens

Direct answer

Tokens are issued credentials such as OAuth access tokens, personal access tokens or session tokens. Prefer short-lived, narrowly scoped tokens and protect refresh tokens like passwords.

When to use this

Use this when handling OAuth, personal access or session tokens.

First 30 seconds

1. Tokens (OAuth, PATs, session) grant access.

2. Short-lived; refresh securely.

3. Never log or put in URLs.

4. Revoke on compromise.

5. Prefer workload identity over long-lived tokens.

Operational verification

issuance → use → expiry/revocation

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common mistakes
  • Tokens logged in application logs or URLs.
  • Personal access tokens with broad scopes and no expiry (GitHub, Azure DevOps).
  • Stored in browser localStorage, readable by XSS.
  • Not revoked when the user or integration is removed.
Platform / version applicability
Cryptography, PKI and secrets
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformCryptography, PKI and secrets
Scope / prerequisiteUse this when handling OAuth, personal access or session tokens.
What next?2 suggested next steps
Evidence1
On this pageJump to a specific section
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Short-lived and narrowly scoped.
  • Refresh tokens are as sensitive as passwords.
  • Revoke on logout or compromise.
Key checks
  • Token lifetimes — short
  • Token storage (no logs/URLs) — protection
  • Revocation capability — incident response
ReferenceWhy it matters1 section · depth on demand

Token types and risks

TokenRisk
OAuth access tokenShort-lived; leaks in logs or URLs
Refresh tokenLong-lived access if stolen
Personal access token (GitHub, GitLab)Often broad scope and long expiry
Session cookieBypasses MFA if stolen (info-stealers)

Set expiry, minimal scopes, monitor creation and use, and revoke on suspicion. Secret scanning (GitHub push protection) catches tokens in repositories.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

Tokens are credentials issued after authentication — OAuth access and refresh tokens, JWTs, session tokens, personal access tokens. Most are bearer tokens: possession is enough to use them, so they must be protected like passwords.

TokenLifetime guidance
Access tokenMinutes to an hour
Refresh tokenLonger; rotate on use; revocable
Personal access tokenExpiry required; minimal scopes
Session cookieIdle and absolute timeouts

Protections: transmit only over TLS, store securely (not in localStorage for sensitive web apps), bind to client where possible (DPoP, mTLS), and monitor for token use from unexpected locations — token theft is increasingly used to bypass MFA.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docCryptography, PKI and secrets current

Authoritative/upstream documentation reviewed for bounded claims in Secrets Management → Tokens. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html · confidence 94%
Confirmation

Confirm action

Continue?