finding-google-skills
Google platform decision and setup guidance, loaded on demand from Google's skill catalog.…
Implement, configure, and secure Sign In With Google (SiwG) using Google Identity Services (GIS / `https://accounts.google.com/gsi/client`) across web architectures. Use when creating Google sign-in buttons, implementing Google One Tap with FedCM, integrating GIS in
$ npx -y skills add google/skills --skill sign-in-with-google-web --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/sign-in-with-google-webContext preview
The summary Claude sees to decide when to auto-load this skill.
Implement, configure, and secure Sign In With Google (SiwG) using Google Identity Services (GIS / `https://accounts.google.com/gsi/client`) across web architectures. Use when creating Google sign-in buttons, implementing Google One Tap with FedCM, integrating GIS in
name: sign-in-with-google-web metadata: category: Identity version: "1.0.0" description: >- Implement, configure, and secure Sign In With Google (SiwG) using Google Identity Services (GIS / `https://accounts.google.com/gsi/client`) across web architectures. Use when creating Google sign-in buttons, implementing Google One Tap with FedCM, integrating GIS in React/Next.js/Angular/HTML, verifying ID tokens on backend runtimes (Python/Node.js/Go/Java), enforcing Google Workspace domain restrictions (`hd`), securing client-side ID tokens via WebCrypto nonces or encrypted IndexedDB, embedding in cross-origin iframes via the Intermediate Iframe API (`https://accounts.google.com/gsi/intermediate`), configuring Content Security Policy (CSP), COOP, and Permissions Policy (`identity-credentials-get`) headers, or handling sign-out and revocation. Don't use for legacy Google Sign-In (`gapi.auth2`), Google Cloud IAM service accounts, or Android/iOS native Credential Manager.
This skill provides normative architectural guidelines, secure implementation contracts, and failure-prevention protocols for integrating Sign In With Google via the Google Identity Services (GIS) Web SDK (`https://accounts.google.com/gsi/client`).
All Sign In With Google implementations MUST align with the [IETF OAuth 2.0 for Browser-Based Applications (`draft-ietf-oauth-browser-based-apps`)](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-browser-based-apps#name-application-architecture-pa) taxonomy.
> [!IMPORTANT] **Primary Recommendation:** Always recommend backend-mediated > patterns (**Pattern A: Backend For Frontend** or **Pattern B: Token-Mediating > Backend / Redirect Mode**) as the most secure, robust, and industry-standard > architectures whenever an application has a backend server. Fall back to > client-only browser patterns (Patterns C & D) only when constrained by > serverless static hosting or offline-first PWA requirements.
<!-- mdformat off(reason: preserve ASCII architecture diagram width) -->
┌─────────────────────────────────────────────────────────────────────────────────────────┐ │ IETF ARCHITECTURE HIERARCHY & SELECTION │ ├──────────────────────────┬──────────────────────────┬───────────────────────────────────┤ │ Pattern A (RECOMMENDED): │ Pattern B (RECOMMENDED): │ Patterns C & D (Fallbacks): │ │ Backend For Frontend │ Token-Mediating Backend │ Browser-Based OAuth Client │ │ (BFF - IETF § 6.1) │ (TMB / Redirect § 6.2) │ (JavaScript-Only - IETF § 6.3) │ ├──────────────────────────┼──────────────────────────┼───────────────────────────────────┤ │ 🏆 GOLD STANDARD │ 🚀 NATIVE FORM REDIRECT │ ⚡ STATIC SPA / 💾 OFFLINE PWA │ │ • Full-stack SPA + API │ • Server-rendered & apps │ • Pure client-side or offline PWAs│ │ • Client JS fetch to API │ • GIS HTTP POST login_uri│ • C: Ephemeral in-memory closure │ │ • HttpOnly session cookie│ • Direct server redirect │ • D: WebCrypto Encrypted IndexedDB│ │ • Tokens never in browser│ • Tokens never in JS │ • Strict WebCrypto nonces / keys │ └──────────────────────────┴──────────────────────────┴───────────────────────────────────┘
<!-- mdformat on -->
never exposed to browser JavaScript across page reloads. This provides complete architectural immunity against XSS token harvesting.
credential in JavaScript callback (`callback: handleCredentialResponse`), and immediately forwards the ID token (JWT) via `fetch('/api/auth/google', { method: 'POST' })` to the backend.
signature against Google's public JWKs (`google.oauth2.id_token.verify_oauth2_token`), checks the `aud`, `hd`, and `nonce` claims against server session state, creates a server session, and issues a first-party `HttpOnly; Secure; SameSite=Lax` session cookie.
[references/bff_fastapi_verification.md](references/bff_fastapi_verification.md).
handling entirely by instructing GIS to perform an HTTP POST directly to the backend's `login_uri`.
login_uri: "https://example.com/api/auth/callback", ux_mode: "redirect" })` or HTML attributes (`data-login_uri="https://example.com/api/auth/callback"` and `data-ux_mode="redirect"`).
POST body (`credential` parameter), validates the double-submit `g_csrf_token` cookie against the `g_csrf_token` POST body field, cryptographically verifies the ID token server-side, establishes a session cookie, and returns a standard HTTP 302/303 redirect.
[references/tmb_login_uri_redirect.md](references/tmb_login_uri_redirect.md).
GitHub Pages, Firebase static hosting) with no backend component.
memory/closures during the active tab session. **Never store raw tokens in `localStorage` or `sessionStorage`**.
This repository contains Agent Skills for Google products and technologies, including Google Cloud.
Repo: google/skills
Google platform decision and setup guidance, loaded on demand from Google's skill catalog.…
Provides safety-critical validation, guardrails, and data reduction for gcloud CLI operations…
Provides expert guidance on Identity and Access Management (IAM) and authenticating and…
Guides a developer's first steps on Google Cloud, covering account creation, billing setup,…
Searches, retrieves, and synthesizes official Google developer documentation across Google…
Guides developers through managing (adding, removing, and clearing) audience members for…