oauth2-oidc
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.
What this skill does
# 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`, and `aud` claims, and never trust client-side token validation alone. - When storing tokens in web apps, use `httpOnly`, `secure`, `sameSite=lax` cookies; 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:** 1. Configure the OIDC providers with client IDs and redirect URIs 2. Implement the Authorization Code + PKCE flow with state and nonce validation 3. Exchange the code for tokens and validate the ID token JWT claims 4. 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:** 1. Fetch the provider's JWKS from the discovery endpoint 2. Create middleware that validates the access token signature, expiration, issuer, and audience 3. Extract user claims and custom scopes from the validated token 4. 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`, and `aud`; never trust client-side validation alone. - Use `httpOnly`, `secure`, `sameSite=lax` cookies 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 email` for login, not all available scopes. - Implement proper logout: revoke refresh token, clear session, redirect to provider's logout endpoint.
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.