sign-in-with-google-web
What it does
This skill helps developers add a Sign In With Google button and One Tap login to websites. It is for web teams who want secure Google login without building it from scratch.
When to use it
- βWhen you want to add a Google sign-in button or One Tap login to a web app.
- βWhen you need to verify Google ID tokens on your backend in Python, Node.js, Go or Java.
- βWhen you want to limit sign-in to a Google Workspace domain.
Skill link
https://github.com/google/skills/blob/main/skills/identity/sign-in-with-google-web/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βAdd Sign In With Google to my React app and verify the login token on my Node.js server.β
5 new skills a week. 1 minute to read.
How it works
It recommends a backend-mediated design where possible, then writes the Google Identity Services code and the server-side token check. It covers One Tap, FedCM and domain restrictions.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Sign In With Google (SiwG) Integration & Security Architecture
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).
1. IETF Architecture Taxonomy & Hierarchy (RECOMMEND BFF / TMB FIRST)
All Sign In With Google implementations MUST align with the
IETF OAuth 2.0 for Browser-Based Applications (draft-ietf-oauth-browser-based-apps)
taxonomy.
<!-- mdformat off(reason: preserve ASCII architecture diagram width) -->[!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.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 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 -->
π Pattern A: Backend For Frontend (BFF - IETF Β§ 6.1) β STRONGLY RECOMMENDED
Why it is the Gold Standard: ID tokens (JWTs) and access tokens are never exposed to browser JavaScript across page reloads. This provides complete architectural immunity against XSS token harvesting.
Architecture: The browser frontend loads the GIS SDK, captures the credential in JavaScript callback (
callback: handleCredentialResponse), and immediately forwards the ID token (JWT) viafetch('/api/auth/google', { method: 'POST' })to the backend.Backend Responsibilities: The backend validates the JWT cryptographic signature against Google's public JWKs (
google.oauth2.id_token.verify_oauth2_token), checks theaud,hd, andnonceclaims against server session state, creates a server session, and issues a first-partyHttpOnly; Secure; SameSite=Laxsession cookie.See full implementation in references/bff_fastapi_verification.md.
π Pattern B: Token-Mediating Backend via login_uri Redirect (IETF Β§ 6.2) β Server-Rendered & Form POST
Why it is Highly Secure: Bypasses client-side JavaScript credential handling entirely by instructing GIS to perform an HTTP POST directly to the backend's
login_uri.Architecture: Configured via
google.accounts.id.initialize({ client_id, login_uri: "https://example.com/api/auth/callback", ux_mode: "redirect" })or HTML attributes (data-login_uri="https://example.com/api/auth/callback"anddata-ux_mode="redirect").Backend Responsibilities: The backend receives the ID token as a form POST body (
credentialparameter), validates the double-submitg_csrf_tokencookie against theg_csrf_tokenPOST body field, cryptographically verifies the ID token server-side, establishes a session cookie, and returns a standard HTTP 302/303 redirect.See full implementation in references/tmb_login_uri_redirect.md.
Pat
FAQ
Which architecture does it recommend?
Backend-mediated patterns first, since they are the most secure, with client-only patterns as a fallback.
Does it cover frameworks?
Yes. It covers React, Next.js, Angular and plain HTML.
Does it check tokens on the server?
Yes. It covers ID token verification for Python, Node.js, Go and Java backends.
Details
Original description by the author
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/intermed
repo: google/skills
Popularity
- GitHub stars
- 22k
- Ranking position
- #10355
- License
- Apache-2.0
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
finding-google-skills
22kHelps your agent find the right Google guides for a setup task, such as hosting, databases, storage, sign-in or AI model serving.
gcloud
22kHelps your agent write and check Google Cloud gcloud commands, looking up exact syntax before it runs anything so it does not guess flags.
google-cloud-recipe-auth
22kGuides your agent through Google Cloud identity and access, including how people and services sign in and which permissions they get.
google-cloud-recipe-onboarding
22kWalks a new developer through first steps on Google Cloud, including choosing a project, linking billing, and deploying a first resource.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.