OAuth 2.0 and OpenID Connect implementation patterns. Use when implementing authentication, authorization flows, or integrating with OAuth providers like Google, GitHub, or custom identity providers.
Implements OAuth 2.0 and OpenID Connect flows with PKCE for secure authentication. Use when building login systems, integrating with providers like Google/GitHub, or handling token refresh and validation.
/plugin marketplace add jpoutrin/product-forge/plugin install security-compliance@product-forge-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
This skill provides guidance for OAuth 2.0 and OpenID Connect implementations.
1. User → App: Click "Login with Google"
2. App → Auth Server: Redirect with client_id, redirect_uri, scope
3. User → Auth Server: Authenticate and consent
4. Auth Server → App: Redirect with authorization code
5. App → Auth Server: Exchange code for tokens
6. Auth Server → App: Access token + refresh token
# Generate code verifier and challenge
code_verifier = secrets.token_urlsafe(32)
code_challenge = base64url(sha256(code_verifier))
# Include in authorization request
params = {
"code_challenge": code_challenge,
"code_challenge_method": "S256",
}
@dataclass
class TokenSet:
access_token: str
refresh_token: str
expires_at: datetime
token_type: str = "Bearer"
async def refresh_tokens(refresh_token: str) -> TokenSet:
# Exchange refresh token for new access token
pass
Extends OAuth 2.0 with identity:
# ID token contains user identity claims
claims = {
"sub": "user123", # Subject (unique user ID)
"email": "user@example.com",
"name": "John Doe",
"iat": 1234567890, # Issued at
"exp": 1234567890, # Expiration
}
Master authentication and authorization patterns including JWT, OAuth2, session management, and RBAC to build secure, scalable access control systems. Use when implementing auth systems, securing APIs, or debugging security issues.