oauth2-oidc
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "oauth2-oidc" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-c7e7d30db3b2da11b60fef2c29ec6bb9f6a7d384fff3476c0c2873ce4267bca8. Verify the upstream source and version against https://github.com/TerminalSkills/skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
oauth2-oidc: Assistance for implementing OAuth 2.0 and OpenID Connect to enable secure authentication and authorization. Applicable for configuring authorization flows, validating tokens, implementing PKCE for public clients, setting up social login, or building secure token handling for SPAs, mobile apps, and APIs. Trigger words include oauth, oidc, openid connect, authorization code, pkce, jwt, access token, refresh token.
Introduction source: third_party · TerminalSkills · 1.0.0 Reference
SkillPi interpretation
- Testing
- Not tested
Browse files
Frontmatter
name: oauth2-oidc
description: >-
Assists with implementing OAuth 2.0 and OpenID Connect for secure authentication and
authorization. Use when configuring authorization flows, validating tokens, implementing
PKCE for public clients, setting up social login, or building secure token handling for
SPAs, mobile apps, and APIs. Trigger words: oauth, oidc, openid connect, authorization
code, pkce, jwt, access token, refresh token.
license: Apache-2.0
compatibility: "No special requirements"
metadata:
author: terminal-skills
version: "1.0.0"
category: devops
tags: ["oauth2", "oidc", "authentication", "authorization", "jwt"]OAuth 2.0 / OpenID Connect
Overview
OAuth 2.0 is the industry standard for API authorization, and OpenID Connect (OIDC) extends it for user authentication. Together they provide Authorization Code + PKCE for secure token exchange, JWT-based identity tokens, refresh token rotation, and integration with identity providers (Auth0, Okta, Keycloak, Google, Azure AD) for social login and enterprise SSO.
Instructions
- When implementing authentication, use the Authorization Code + PKCE flow for all client types (SPAs, mobile, server) since it is the only secure flow; never use the deprecated Implicit or Resource Owner Password flows.
- When validating tokens on the API side, verify the JWT signature using the provider's JWKS endpoint, check
exp,iss, andaudclaims, and never trust client-side token validation alone. - When storing tokens in web apps, use
httpOnly,secure,sameSite=laxcookies; never store tokens in localStorage since it is vulnerable to XSS. - When managing token lifecycle, use short-lived access tokens (5-15 minutes) with refresh token rotation where each refresh token is single-use and a new one is issued with each refresh.
- When integrating a provider, use the discovery endpoint (
/.well-known/openid-configuration) for auto-configuration rather than hardcoding endpoints. - When implementing logout, revoke the refresh token, clear the session, and redirect to the provider's logout endpoint for complete session termination.
Examples
Example 1: Add social login to a Next.js app with PKCE
User request: "Implement Google and GitHub login for my Next.js app using OAuth 2.0"
Actions:
- Configure the OIDC providers with client IDs and redirect URIs
- Implement the Authorization Code + PKCE flow with state and nonce validation
- Exchange the code for tokens and validate the ID token JWT claims
- Store the session in httpOnly cookies with refresh token rotation
Output: A Next.js app with secure social login via Google and GitHub, PKCE-protected token exchange, and httpOnly cookie sessions.
Example 2: Secure a REST API with JWT validation
User request: "Add OAuth 2.0 token validation to my API endpoints"
Actions:
- Fetch the provider's JWKS from the discovery endpoint
- Create middleware that validates the access token signature, expiration, issuer, and audience
- Extract user claims and custom scopes from the validated token
- Return 401 for invalid tokens and 403 for insufficient scopes
Output: An API with JWT-based authorization that validates tokens against the provider's JWKS and enforces scope-based access control.
Guidelines
- Always use Authorization Code + PKCE since it is the only secure flow for all client types.
- Validate tokens on the API side: verify signature,
exp,iss, andaud; never trust client-side validation alone. - Use
httpOnly,secure,sameSite=laxcookies for token storage in web apps, not localStorage. - Implement refresh token rotation where each refresh token is single-use.
- Use the provider's discovery endpoint for configuration rather than hardcoding endpoints.
- Request minimum scopes needed:
openid emailfor login, not all available scopes. - Implement proper logout: revoke refresh token, clear session, redirect to provider's logout endpoint.
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供 OAuth 2.0 和 OpenID Connect 的完整实现指导,覆盖主流应用场景(SPA、移动应用、API 安全)
- 解决开发者高频刚需的安全认证问题,内容专业且实用
Highlights
- 触发词覆盖全面(oauth、oidc、pkce、jwt 等),边界清晰,无歧义
Highlights
- Phase/步骤清晰(Overview、Instructions、Examples、Guidelines),有端到端示例(Next.js 登录、API JWT 验证)
- frontmatter 完整,单文件未超限
Highlights
- 工具来源明确(行业标准协议),参数正确(PKCE、JWT 验证、cookie 设置)
- 覆盖主要异常(token 验证失败、scope 不足),不可逆操作有确认机制(logout 流程)
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Accounts, secrets or authorization
Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.
Mentioned in main document · lines 4, 7, 8, 18, 22
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.