Need Help Implementing OAuth/OIDC?
Our security experts can help you implement secure OAuth 2.0 and OpenID Connect authentication in your applications. We provide architecture review, implementation guidance, and security audits for your authentication systems.
Debug OAuth and OIDC Flows
Test OAuth 2.0 authorization flows and decode OIDC tokens. Essential for authentication troubleshooting.
Supported Flows
- Authorization Code (with PKCE)
- Client Credentials
- Implicit (legacy)
- Device Code
Token Analysis
Decode access tokens and ID tokens. Verify signatures, check claims, validate expiration.
How JWT Decoding Works
JWT Token Structure
A JWT token consists of three parts separated by dots (.):
- Header - Contains metadata about the token type and signing algorithm
- Payload - Contains claims (statements about the user and additional data)
- Signature - Used to verify the token hasn't been tampered with
Decoding Process
Each part is Base64URL encoded. To decode a JWT:
- Split the token by the dot (.) separator
- Base64URL decode each part
- Parse the header and payload as JSON
- The signature remains as a Base64URL string
Important Security Note
Decoding a JWT does not verify its signature. Anyone can decode a JWT and read its contents. Always verify the signature server-side before trusting the claims in a token.
PKCE Implementation Guide
Implementing PKCE in Your Application
PKCE (Proof Key for Code Exchange) adds security to the OAuth authorization code flow. Here's how to implement it:
Step 1: Generate Code Verifier
Create a cryptographically random string (43-128 characters):
- Use a secure random number generator
- Encode as Base64URL
- Store securely in your application
Step 2: Create Code Challenge
Compute the SHA-256 hash of the code verifier and encode it as Base64URL:
code_challenge = BASE64URL(SHA256(code_verifier))
Step 3: Authorization Request
Include these parameters in your authorization URL:
code_challenge- The computed challengecode_challenge_method- Set to "S256"
Step 4: Token Exchange
When exchanging the authorization code for tokens, include:
code_verifier- The original verifier (NOT the challenge)
The authorization server will verify that SHA256(code_verifier) matches the code_challenge from the authorization request.
Common OAuth Error Solutions
Troubleshooting OAuth Errors
invalid_grant
Most Common Causes:
- Authorization code expired (typically >10 minutes)
- Code was already used (single-use only)
- Redirect URI mismatch
Solutions:
- Ensure code exchange happens quickly
- Never reuse authorization codes
- Use exact redirect_uri in both requests
invalid_client
Most Common Causes:
- Wrong client_id or client_secret
- Client authentication method mismatch
Solutions:
- Verify credentials match your provider dashboard
- Check if using correct auth method (basic, post, jwt)
unauthorized_client
Most Common Causes:
- Grant type not enabled for client
- Redirect URI not registered
Solutions:
- Enable required grant types in provider settings
- Register all redirect URIs (exact match required)
access_denied
Most Common Causes:
- User clicked "Deny" on consent screen
- User lacks required permissions
Solutions:
- Handle denial gracefully in your app
- Request only necessary scopes
- Provide clear explanation of why permissions are needed
OAuth Security Best Practices
Securing Your OAuth Implementation
1. Always Use PKCE
PKCE is no longer just for public clients. Use it for all OAuth flows to prevent authorization code interception attacks.
2. Short-Lived Access Tokens
Keep access tokens short-lived (5-15 minutes). Use refresh tokens for longer sessions.
3. Validate State Parameter
Always generate a unique state parameter for each authorization request and validate it on callback. This prevents CSRF attacks.
4. Exact Redirect URI Matching
Never use wildcards or regex for redirect URIs. OAuth requires exact string matching for security.
5. Verify Token Signatures
Always verify JWT signatures server-side before trusting token contents. Don't skip this step!
6. Check Token Expiration
Validate the exp claim and reject expired tokens. Don't accept tokens without expiration.
7. Secure Token Storage
- Never store tokens in localStorage (vulnerable to XSS)
- Use httpOnly cookies for refresh tokens
- Store access tokens in memory when possible
8. Use HTTPS Everywhere
Never use OAuth over unencrypted HTTP in production. All endpoints must use HTTPS.
9. Implement Token Rotation
Rotate refresh tokens on each use to limit exposure if compromised.
10. Limit Scope Permissions
Request only the minimum scopes your application needs. Follow the principle of least privilege.
References & Citations
- Internet Engineering Task Force (IETF). (2012). RFC 6749: The OAuth 2.0 Authorization Framework. Retrieved from https://datatracker.ietf.org/doc/html/rfc6749 (accessed January 2025)
- Internet Engineering Task Force (IETF). (2015). RFC 7636: Proof Key for Code Exchange by OAuth Public Clients (PKCE). Retrieved from https://datatracker.ietf.org/doc/html/rfc7636 (accessed January 2025)
- Internet Engineering Task Force (IETF). (2015). RFC 7519: JSON Web Token (JWT). Retrieved from https://datatracker.ietf.org/doc/html/rfc7519 (accessed January 2025)
- Internet Engineering Task Force (IETF). (2015). RFC 7515: JSON Web Signature (JWS). Retrieved from https://datatracker.ietf.org/doc/html/rfc7515 (accessed January 2025)
- OpenID Foundation. (2014). OpenID Connect Core 1.0. Retrieved from https://openid.net/specs/openid-connect-core-1_0.html (accessed January 2025)
- Internet Engineering Task Force (IETF). (2020). RFC 8725: JSON Web Token Best Current Practices. Retrieved from https://datatracker.ietf.org/doc/html/rfc8725 (accessed January 2025)
- Internet Engineering Task Force (IETF). (2022). OAuth 2.0 Security Best Current Practice. Retrieved from https://datatracker.ietf.org/doc/html/draft-ietf-oauth-security-topics (accessed January 2025)
- OWASP Foundation. OWASP Authentication Cheat Sheet. Retrieved from https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html (accessed January 2025)
Note: These citations are provided for informational and educational purposes. Always verify information with the original sources and consult with qualified professionals for specific advice related to your situation.
Key Security Terms
Understand the essential concepts behind this tool
OAuth (Open Authorization)
An open standard for delegated access authorization that allows applications to access user resources without exposing credentials.
JSON Web Token (JWT)
A compact, URL-safe token format used to securely transmit claims between parties in web applications.
Frequently Asked Questions
Common questions about the OAuth/OIDC Debugger
Paste your JWT token into the "JWT Decoder" tab. The tool will automatically decode the header, payload, and signature. You'll see all claims with syntax highlighting, validation status, and expiration warnings. Optionally provide a secret to verify the signature. All decoding happens in your browser - tokens are never sent to any server.
Explore More Tools
Continue with these related tools
JWT Decoder
Decode and analyze JSON Web Tokens (JWT) to inspect headers, payloads, and signatures for debugging and security analysis
Base64 Encoder/Decoder
Encode and decode Base64 strings for data transport, email attachments, and web development
JSON Formatter
Format, validate, and beautify JSON data with syntax highlighting and error detection
Free Hash Generator - MD5, SHA256, bcrypt & More
Free online hash calculator with malware checking. Generate MD5, SHA-256, SHA-512, SHA-3, bcrypt & more. Batch file hashing, threat intelligence integration (VirusTotal, MalwareBazaar), hash history tracking. Instant results, no signup.
Password Strength Checker
Test password strength and get instant feedback on security with entropy analysis and breach database checking
⚠️ Security Notice
This tool is provided for educational and authorized security testing purposes only. Always ensure you have proper authorization before testing any systems or networks you do not own. Unauthorized access or security testing may be illegal in your jurisdiction. All processing happens client-side in your browser - no data is sent to our servers.