Back to skills
SKILL.md
Oauth Oidc
ASecurityOAuth 2.x and OIDC — flows (authorization code + PKCE, client credentials, device), token types and lifetimes, refresh rotation, scopes and audiences, ID token validation, logout, federation (SAML bridging), BFF pattern for SPAs. Use for login, SSO, delegated access and service-to-service auth (OAuth, OIDC, SSO, PKCE, refresh token, scopes).
- 5 stars
- 0 votes
- 0 copies
- 0 views
- Added December 3, 2026
Works with
Security analysis
100/100npx -y skills add vectora-os/kit --skill oauth-oidc --agent claude-codeAre you the author of Oauth Oidc?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/vectora-os-oauth-oidc)---
name: oauth-oidc
description: OAuth 2.x and OIDC — flows (authorization code + PKCE, client credentials, device), token types and lifetimes, refresh rotation, scopes and audiences, ID token validation, logout, federation (SAML bridging), BFF pattern for SPAs. Use for login, SSO, delegated access and service-to-service auth (OAuth, OIDC, SSO, PKCE, refresh token, scopes).
metadata:
category: security
---
# OAuth 2 and OpenID Connect
## Purpose
Implement authentication and delegated authorization with the right flow and safe token handling.
**Use when:** login, SSO, API access delegation.
**Not for:** authorization model design (`authorization-models`).
## Inputs
- Clients, identity provider, security requirements.
## Outputs
- Flow design, token policy, validation rules, tests.
## Read first
- [Project Brain](../../../project-brain/README.md) — `npm run brain -- query "oauth 2 and openid connect"` for prior decisions, patterns and anti-patterns.
- [Security standard](../../../standards/security.md)
## Steps
1. **Flow.** Auth code + PKCE for user apps; client credentials for services; never implicit or password grant.
Done when flow per client type.
2. **Tokens.** Short access tokens, rotating refresh tokens, audience and scope minimal.
Done when lifetimes documented.
3. **Validate.** Validate issuer, audience, signature (JWKS), expiry, nonce.
Done when negative tests pass.
4. **Session.** BFF for SPAs with HttpOnly cookies; logout and revocation.
Done when tokens never in localStorage.
## Best practices
- Use well-maintained libraries.
- Exact redirect URI matching.
## Common mistakes
- Accepting tokens for other audiences.
- Long-lived access tokens.
## Example
SPA via BFF: auth code + PKCE server-side, session cookie SameSite=Lax, 10-minute access tokens, refresh rotation with reuse detection.
## Reusable prompt
```text
Apply the OAuth 2 and OpenID Connect skill (.agents/skills/oauth-oidc/SKILL.md).
Context: {{task card or question; links to PRD, ADRs, code paths}}
Constraints: {{approved thresholds, deadlines, allowed files}}
Choose flows per client, define token lifetimes and validation, and specify session handling and tests.
Return: Flow design, token policy, validation rules, tests..
Cite evidence (file:line, command output, source) for every claim; list open questions separately.
```
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.