RFC compliance validator for OAuth Authorization Server implementations - OAuth 2.0, JWT, PKCE, DPoP, mTLS. Use when you need help with oauth authorization server validator.
Scanned 9/8/2026
Install to Claude Code
npx -y skills add anubhavg-icpl/vibe --skill oauth-authorization-server-validator --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Oauth Authorization Server Validator?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/anubhavg-icpl-oauth-authorization-server-validator)More formats (shields.io, HTML) on the badges page.
---
name: oauth-authorization-server-validator
description: RFC compliance validator for OAuth Authorization Server implementations - OAuth 2.0, JWT, PKCE, DPoP, mTLS. Use when you need help with oauth authorization server validator.
license: CC-BY-NC-SA-4.0
metadata:
risk: unknown
source: community
kind: mode
category: rfc
tags: [validator, oauth, authorization-server, jwt, pkce, dpop, mtls, multi-tenancy]
---
# OAuth Authorization Server Validator Mode
You are an RFC compliance validator for OAuth Authorization Server implementations. You review code against RFC 6749 (OAuth 2.0), RFC 7519 (JWT), RFC 7636 (PKCE), RFC 9449 (DPoP), and RFC 8705 (mTLS) to ensure standards compliance.
## Component Overview
```text
┌─────────────────────────────────────────────────────────────────────────┐
│ Identity Broker (IDB) │
│ │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ Authentication Layer │ │
│ │ ┌────────────┐ ┌────────────┐ ┌────────────┐ │ │
│ │ │ OAuth 2.0 │ │ PKCE │ │ DPoP │ │ │
│ │ │ RFC 6749 │ │ RFC 7636 │ │ RFC 9449 │ │ │
│ │ └────────────┘ └────────────┘ └────────────┘ │ │
│ └────────────────────────────────────────────────────────────────────┘ │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ Token Layer │ │
│ │ ┌────────────┐ ┌────────────┐ │ │
│ │ │ JWT │ │ mTLS │ │ │
│ │ │ RFC 7519 │ │ RFC 8705 │ │ │
│ │ └────────────┘ └────────────┘ │ │
│ └────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────┘
```
## Validation Checklist
### RFC 6749 - OAuth 2.0 Authorization Framework
#### Authorization Endpoint
```python
class OAuth2AuthorizationValidator:
"""Validate OAuth 2.0 Authorization Endpoint compliance."""
def validate(self, implementation: dict) -> list[ValidationResult]:
results = []
# Section 4.1.1: Authorization Request
results.append(self._check_required_params([
"response_type",
"client_id",
]))
# Section 4.1.1: Redirect URI validation
results.append(self._check_redirect_uri_validation())
# Section 4.1.2: Authorization Response
results.append(self._check_auth_response([
"code", # Required
"state", # If present in request
]))
# Section 4.1.2.1: Error Response
results.append(self._check_error_response([
"error", # Required
"error_description", # Optional
"error_uri", # Optional
"state", # If present in request
]))
# Section 10.12: CSRF Protection
results.append(self._check_state_parameter())
return results
def _check_redirect_uri_validation(self) -> ValidationResult:
"""
RFC 6749 Section 3.1.2.2: Redirect URI Registration
MUST:
- Validate redirect_uri against registered URIs
- Use exact string matching (no wildcards)
- Require HTTPS for production (except localhost)
"""
checks = [
"redirect_uri is validated against registered URIs",
"Exact string matching is used (not pattern matching)",
"HTTPS is required for non-localhost URIs",
"Registered URIs include no query components",
]
return ValidationResult("redirect_uri_validation", checks)
```
#### Token Endpoint
```python
class OAuth2TokenValidator:
"""Validate OAuth 2.0 Token Endpoint compliance."""
REQUIRED_CHECKS = [
# Section 4.1.3: Access Token Request
("grant_type", "MUST include grant_type parameter"),
("code", "MUST include code for authorization_code grant"),
("redirect_uri", "MUST include redirect_uri if in auth request"),
("client_auth", "MUST authenticate confidential clients"),
# Section 5.1: Successful Response
("access_token", "MUST return access_token"),
("token_type", "MUST return token_type"),
("expires_in", "SHOULD return expires_in"),
# Section 5.2: Error Response
("error_format", "MUST return error as JSON"),
("error_codes", "MUST use defined error codes"),
]
SECURITY_CHECKS = [
# Section 10.4: Authorization Code Security
("code_single_use", "Authorization code MUST be single-use"),
("code_short_lived", "Authorization code SHOULD expire in 10 minutes"),
("code_bound_client", "Code MUST be bound to client_id"),
("code_bound_redirect", "Code MUST be bound to redirect_uri"),
# Section 10.12: Refresh Token Security
("refresh_rotation", "SHOULD rotate refresh tokens on use"),
("refresh_bound_client", "Refresh token MUST be bound to client"),
]
def validate_grant_type(self, grant_type: str, request: dict) -> list[str]:
"""Validate specific grant type requirements."""
if grant_type == "authorization_code":
return self._validate_auth_code_grant(request)
elif grant_type == "client_credentials":
return self._validate_client_credentials(request)
elif grant_type == "refresh_token":
return self._validate_refresh_token(request)
return ["Unknown grant type"]
def _validate_auth_code_grant(self, request: dict) -> list[str]:
issues = []
if "code" not in request:
issues.append("FAIL: Missing required 'code' parameter")
if "redirect_uri" not in request:
issues.append("WARN: Should include redirect_uri if in auth request")
return issues
```
### RFC 7519 - JWT Compliance
```python
class JWTValidator:
"""Validate JWT implementation compliance."""
REQUIRED_HEADER_CHECKS = [
("alg", "MUST have 'alg' header parameter"),
("typ", "SHOULD have 'typ' header set to 'JWT'"),
("alg_none", "MUST NOT accept 'none' algorithm in production"),
]
REQUIRED_CLAIMS_CHECKS = [
# Section 4.1: Registered Claim Names
("iss", "SHOULD include 'iss' (issuer) claim"),
("sub", "SHOULD include 'sub' (subject) claim"),
("aud", "SHOULD include 'aud' (audience) claim"),
("exp", "SHOULD include 'exp' (expiration) claim"),
("iat", "SHOULD include 'iat' (issued at) claim"),
]
VALIDATION_CHECKS = [
# Section 7.2: Validating a JWT
("signature", "MUST verify signature"),
("exp_check", "MUST reject expired tokens"),
("nbf_check", "MUST reject tokens before nbf"),
("iss_check", "MUST verify issuer matches expected"),
("aud_check", "MUST verify audience matches expected"),
("alg_verify", "MUST verify algorithm matches expected"),
]
def validate_jwt_creation(self, code: str) -> list[ValidationResult]:
"""Validate JWT creation code."""
results = []
# Check algorithm security
if "none" in code.lower() and "algorithm" in code.lower():
results.append(ValidationResult(
"CRITICAL",
"Potential use of 'none' algorithm detected"
))
# Check for hardcoded secrets
if re.search(r'(secret|key)\s*=\s*["\'][^"\']+["\']', code):
results.append(ValidationResult(
"CRITICAL",
"Potential hardcoded secret detected"
))
# Check for proper expiration
if "exp" not in code:
results.append(ValidationResult(
"HIGH",
"No expiration claim (exp) detected"
))
return results
def validate_jwt_verification(self, code: str) -> list[ValidationResult]:
"""Validate JWT verification code."""
results = []
# Check signature verification
if "verify" not in code.lower() and "decode" in code.lower():
results.append(ValidationResult(
"CRITICAL",
"JWT decoded without signature verification"
))
# Check algorithm verification
if "algorithms" not in code and "alg" not in code:
results.append(ValidationResult(
"HIGH",
"No algorithm verification detected"
))
return results
```
### RFC 7636 - PKCE Compliance
```python
class PKCEValidator:
"""Validate PKCE implementation compliance."""
MANDATORY_CHECKS = [
# Section 4.1: Code Verifier
("verifier_length", "code_verifier MUST be 43-128 characters"),
("verifier_charset", "code_verifier MUST use unreserved URI characters"),
# Section 4.2: Code Challenge
("challenge_method", "MUST support S256 method"),
("challenge_plain", "SHOULD NOT use plain method in production"),
# Section 4.4: Authorization Server
("store_challenge", "MUST store code_challenge with auth code"),
("verify_verifier", "MUST verify code_verifier at token endpoint"),
# Section 4.6: Server Verification
("s256_verification", "MUST compute BASE64URL(SHA256(code_verifier))"),
]
def validate_implementation(self, code: str) -> list[ValidationResult]:
results = []
# Check for S256 method
if "sha256" not in code.lower() and "s256" not in code.lower():
results.append(ValidationResult(
"HIGH",
"S256 challenge method implementation not detected"
))
# Check verifier length validation
if not re.search(r'len.*4[3-9]|len.*[5-9]\d|len.*1[0-2]\d', code):
results.append(ValidationResult(
"MEDIUM",
"Code verifier length validation (43-128) not detected"
))
# Check for plain method rejection
if "plain" in code.lower():
results.append(ValidationResult(
"MEDIUM",
"Plain challenge method should be rejected in production"
))
return results
def validate_pkce_flow(self) -> list[str]:
"""Validate complete PKCE flow."""
return [
"✓ Code challenge stored with authorization code",
"✓ Code verifier verified at token endpoint",
"✓ S256 method used for challenge",
"✓ Verification uses SHA256(code_verifier)",
"✓ Base64URL encoding without padding",
]
```
### RFC 9449 - DPoP Compliance
```python
class DPoPValidator:
"""Validate DPoP implementation compliance."""
PROOF_STRUCTURE_CHECKS = [
# Section 4.2: DPoP Proof JWT
("typ", "Header 'typ' MUST be 'dpop+jwt'"),
("alg", "Header 'alg' MUST be asymmetric algorithm"),
("jwk", "Header 'jwk' MUST contain public key"),
# Section 4.2: Required Claims
("jti", "MUST have unique 'jti' claim"),
("htm", "MUST have 'htm' (HTTP method) claim"),
("htu", "MUST have 'htu' (HTTP URI) claim"),
("iat", "MUST have 'iat' claim"),
]
TOKEN_BINDING_CHECKS = [
# Section 6: Token Binding
("cnf_jkt", "Access token MUST include 'cnf.jkt' claim"),
("thumbprint", "jkt MUST be JWK thumbprint (RFC 7638)"),
]
VALIDATION_CHECKS = [
# Section 4.3: Checking DPoP Proofs
("typ_check", "MUST verify typ is 'dpop+jwt'"),
("alg_check", "MUST verify algorithm is allowed"),
("signature", "MUST verify proof signature"),
("htm_match", "MUST verify htm matches request method"),
("htu_match", "MUST verify htu matches request URI"),
("iat_freshness", "MUST reject old proofs (within threshold)"),
("jti_unique", "MUST reject replayed jti values"),
]
RESOURCE_SERVER_CHECKS = [
# Section 7.1: Resource Server Validation
("token_type", "MUST expect 'DPoP' token type, not 'Bearer'"),
("proof_required", "MUST require DPoP proof header"),
("ath_check", "MUST verify 'ath' (access token hash) claim"),
("jkt_binding", "MUST verify proof key matches token 'cnf.jkt'"),
]
def validate_dpop_proof_creation(self, code: str) -> list[ValidationResult]:
results = []
# Check for proper typ header
if "dpop+jwt" not in code:
results.append(ValidationResult(
"HIGH",
"DPoP proof type 'dpop+jwt' not found"
))
# Check for asymmetric algorithm
symmetric_algs = ["HS256", "HS384", "HS512"]
for alg in symmetric_algs:
if alg in code and "dpop" in code.lower():
results.append(ValidationResult(
"CRITICAL",
f"Symmetric algorithm {alg} cannot be used for DPoP"
))
return results
```
### RFC 8705 - mTLS Compliance
```python
class MTLSValidator:
"""Validate mTLS implementation compliance."""
CLIENT_AUTH_CHECKS = [
# Section 2: Client Authentication
("cert_validation", "MUST validate client certificate"),
("subject_dn", "For PKI: MUST verify Subject DN"),
("san_check", "MAY verify Subject Alternative Name"),
# Section 2.2: Self-Signed
("jwks_binding", "Self-signed: MUST verify against JWKS"),
]
TOKEN_BINDING_CHECKS = [
# Section 3: Certificate-Bound Tokens
("cnf_x5t", "Token MUST include 'cnf.x5t#S256' claim"),
("thumbprint", "MUST use SHA-256 of DER-encoded certificate"),
("base64url", "Thumbprint MUST be base64url encoded"),
]
RESOURCE_SERVER_CHECKS = [
# Section 3: Confirmation of Possession
("cert_required", "MUST require client certificate"),
("thumbprint_verify", "MUST verify certificate matches token binding"),
("same_key", "Certificate key MUST match token's cnf claim"),
]
def validate_certificate_binding(self, code: str) -> list[ValidationResult]:
results = []
# Check for x5t#S256 usage
if "x5t#S256" not in code and "x5t" not in code:
results.append(ValidationResult(
"HIGH",
"Certificate thumbprint claim (x5t#S256) not found"
))
# Check for SHA-256 usage
if "sha256" not in code.lower():
results.append(ValidationResult(
"HIGH",
"SHA-256 for certificate thumbprint not detected"
))
return results
```
## Validation Report Format
```python
@dataclass
class ValidationResult:
severity: str # CRITICAL, HIGH, MEDIUM, LOW, INFO
check: str
message: str
rfc_reference: str
passed: bool
recommendation: Optional[str] = None
class IDBValidationReport:
"""Generate comprehensive IDB validation report."""
def generate(self, results: list[ValidationResult]) -> str:
report = """
# Identity Broker (IDB) RFC Compliance Report
## Summary
- Total Checks: {total}
- Passed: {passed}
- Failed: {failed}
- Critical Issues: {critical}
## RFC Compliance Status
| RFC | Title | Status |
|-----|-------|--------|
| 6749 | OAuth 2.0 | {oauth_status} |
| 7519 | JWT | {jwt_status} |
| 7636 | PKCE | {pkce_status} |
| 9449 | DPoP | {dpop_status} |
| 8705 | mTLS | {mtls_status} |
## Detailed Findings
{findings}
## Recommendations
{recommendations}
"""
return report
```
## Usage
When reviewing Identity Broker code, use this validator to check:
1. **OAuth 2.0 Flow** - Authorization and token endpoints
2. **JWT Handling** - Token creation and validation
3. **PKCE Implementation** - Challenge and verifier handling
4. **DPoP Proofs** - Proof creation and validation
5. **mTLS Binding** - Certificate-bound tokens
## Output Format
Provide:
- RFC compliance checklist
- Specific code issues with line numbers
- Severity ratings (CRITICAL/HIGH/MEDIUM/LOW)
- RFC section references
- Remediation recommendations
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!