Everything, Everywhere
Verified Specification | Standardized Formulas | Instant Precision
Secure & Private (Zero Data Retention) Free Access • No Sign-Up

OAuth 2.0 & OIDC Flow Architect

Construct RFC 7636 PKCE authorization requests, generate cryptographic verifiers, decode OIDC ID tokens, and audit authorization vulnerabilities.

Auth Code + PKCE
Active Flow (RFC 7636)
S256
Code Challenge Method
256 bits
Verifier Cryptographic Entropy
SECURE
OAuth 2.1 Compliance
Calculating...
Generating cURL...
RFC 7636 Cryptographic Spec: The Code Verifier is a cryptographically random string between 43 and 128 characters drawn from [A-Z, a-z, 0-9, -, ., _, ~]. The Code Challenge is BASE64URL-ENCODE(SHA256(ASCII(code_verifier))).
Length: 64 characters (Valid RFC 7636 range: 43 - 128) Valid URL-Safe Charset [A-Za-z0-9-._~]
Calculating...
Calculating...

Live Challenge-Verifier Match Tester

Emulate authorization server validation: Paste any Verifier and Challenge to verify cryptographic equivalence.

OpenID Connect Token Response & ID Token Inspector

Inspect JWT header, claims, audience, expiry, and nonce validity in real-time.
Generating...

OIDC ID Token (JSON Web Token) Dissection

HEADER (Algorithm & Token Type)
...
SIGNATURE (RS256 / ES256)
...
PAYLOAD (Claims & Identity Attributes)
...

Claims Validation Audit

Interactive OAuth 2.0 Threat & Exploit Matrix

Inspect how real-world attackers exploit OAuth configurations and how RFC protocols mitigate each vulnerability.

1. Authorization Code Interception Attack (RFC 7636) MITIGATED BY PKCE

The Threat: On mobile operating systems (iOS/Android) and desktop platforms, multiple applications can register identical custom URL schemes (e.g. myapp://oauth/callback). An attacker creates a rogue app that registers the same scheme. When the user completes authorization, the OS may route the redirect with the raw ?code=XYZ to the attacker's app.

The PKCE Defense: The legitimate client holds the private code_verifier in memory and only sends the SHA-256 hash (code_challenge) to the authorization server. Even if the attacker intercepts the code, they cannot exchange it at the token endpoint because they cannot supply the original plaintext verifier.

2. CSRF Account-Linking Injection (RFC 6749 §10.12) MITIGATED BY STATE

The Threat: An attacker initiates an OAuth flow, receives an authorization code linked to their own account, and halts the flow before redemption. They construct a link to the victim's app callback (/callback?code=ATTACKER_CODE) and trick the victim into clicking it. The victim's browser sends the request with their active session cookie, linking the victim's account or data to the attacker's credentials.

The State Defense: The client stores a cryptographically random, unguessable state token in an HttpOnly session cookie before redirecting to the provider. Upon return, the callback verifies that request.query.state === session.state. The attacker's forged link lacks the matching session token and is rejected.

3. Open Redirector & Wildcard Callback Leaks MITIGATED BY EXACT URI MATCHING

The Threat: If an authorization server allows wildcard redirect URIs (e.g. https://*.example.com/*) or prefix matching, an attacker leverages an open redirector on a subdomain (e.g. https://blog.example.com/redirect?to=evil.com) to redirect the authorization code or token fragment directly to an attacker-controlled server.

The OAuth 2.1 Defense: Authorization servers must require strict, exact string comparison for registered redirect_uri values. Wildcards, path traversals, and query parameter expansions are prohibited.

4. Confused Deputy & Cross-Client Token Reuse MITIGATED BY AUD & NONCE CLAIMS

The Threat: An attacker creates a malicious third-party app that prompts users to "Sign in with Google". Once the victim signs in, the attacker takes the issued ID Token or Access Token and sends it to your high-value enterprise API. If your API verifies the signature against Google's public keys but forgets to check the aud (audience) claim, it accepts the attacker's token and grants unauthorized access to the victim's data.

The Audience Defense: Every resource server and backend must verify that the aud claim in the token strictly equals its own registered client_id.

OAuth 2.0 & OIDC Modern Protocol Architecture

OAuth 2.0 (RFC 6749) is an authorization delegation framework, while OpenID Connect (OIDC) is an identity authentication layer built directly on top of OAuth 2.0. Understanding the cryptographic boundaries between client, authorization server, and resource server is essential for securing modern distributed architectures.

Architectural Showdowns: Protocol Design Comparisons

PKCE S256 Challenge

Mandates SHA-256 one-way hashing followed by Base64URL encoding. The authorization server never sees the plaintext verifier until token redemption.

  • One-way cryptographic commitment prevents eavesdropping
  • Mandatory for public and confidential clients in OAuth 2.1
  • Mitigates TLS inspection and server log leakage
Plain PKCE (Deprecated)

Sends the raw verifier string as the code_challenge directly in the URL query string, providing zero hashing protection.

  • Exposed in proxy logs, browser history, and Referer headers
  • Permitted only on severely resource-constrained microcontrollers
  • Explicitly forbidden in OAuth 2.1 specifications
Authorization Code + PKCE

Tokens are issued only via a secure backchannel POST request to the token endpoint, sender-constrained by the ephemeral verifier.

  • Tokens never touch browser address bar or referrer headers
  • Enables issuance of cryptographically bound refresh tokens
  • Universal standard for SPAs, mobile apps, and servers
Implicit Grant (Deprecated)

Returns access tokens directly in the URL hash fragment (#access_token=...), completely bypassing client backchannel authentication.

  • Tokens leaked to browser history and third-party scripts
  • No refresh tokens permitted due to lack of client auth
  • Officially removed in OAuth 2.1 and IETF BCP
JWT Self-Contained Tokens

Cryptographically signed JSON Web Tokens carrying claims (user ID, roles, scopes) validated statelessly using public keys (JWKS).

  • Zero database lookup latency across microservices
  • Standardized structure across vendors via RFC 7519
  • Revocation requires short TTLs or distributed blocklists
Opaque Reference Tokens

High-entropy random strings with no embedded data. Resource servers query an introspection endpoint (RFC 7662) to resolve token metadata.

  • Instant token revocation capability at authorization server
  • No internal architecture details exposed to clients
  • Requires network roundtrip for each API request

Five Fatal OAuth 2.0 & OIDC Implementation Pitfalls

1. Storing Access and Refresh Tokens in Browser localStorage

Storing JWTs or bearer tokens in localStorage or sessionStorage provides zero protection against Cross-Site Scripting (XSS). Any third-party NPM dependency, unescaped user input, or compromised CDN script can execute localStorage.getItem('token') and exfiltrate authentication credentials. Production SPAs should use the Backend-For-Frontend (BFF) pattern or store tokens in encrypted, HttpOnly, SameSite=Strict cookies.

2. Ignoring or Static Hardcoding of the "state" Parameter

Treating the state parameter as optional or hardcoding a static string like state=12345 leaves the application completely vulnerable to CSRF login injection. Attackers can trick a logged-in user into visiting an authorization callback with the attacker's pre-generated code, permanently binding the victim's session to the attacker's identity.

3. Permissive Wildcard redirect_uri Registration

Registering wildcard patterns such as https://*.example.com/* or https://example.com/oauth/callback?* enables attackers to exploit open redirectors or directory traversal flaws to forward authorization codes to external servers. OAuth 2.1 explicitly requires strict exact-string URL matching for all redirect URIs.

4. Accepting the "alg": "none" JWT Signature Bypass

Naive JWT verification libraries that read the alg header from an incoming token and skip verification if alg: "none" is present allow attackers to forge arbitrary claims, grant themselves administrative privileges, and bypass all authentication checks. Production backends must enforce strict algorithm whitelisting (e.g. RS256, ES256) and reject unsigned tokens unconditionally.

5. Omitting ID Token "nonce" and "aud" Claim Verification

Validating only the cryptographic signature of an ID token while ignoring the nonce and aud claims leaves the client open to replay attacks and confused deputy vulnerabilities. An ID token intercepted from another client belonging to the same identity provider can be replayed against your application unless the audience claim is rigorously validated.

Sponsored Utility
While You're Here
Sponsored Recommendations
Advertisement