Skip to content
Back to skills

Oauth Oidc

ASecurity

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).

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentsgoapisecurity

Works with

  • cli
  • api

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add vectora-os/kit --skill oauth-oidc --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Oauth Oidc?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Oauth Oidc
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectora-os-oauth-oidc/badge)](https://www.skillsdirectory.com/skills/vectora-os-oauth-oidc)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.