sign-in-with-google-web
Fungsinya
Skill ini membantu developer menambahkan tombol Sign In With Google dan login One Tap ke situs web. Skill ini ditujukan untuk tim web yang menginginkan login Google yang aman tanpa membangunnya dari awal.
Kapan dipakai
- βSaat Anda ingin menambahkan tombol login Google atau login One Tap ke aplikasi web.
- βSaat Anda perlu memverifikasi ID token Google di backend Anda dengan Python, Node.js, Go, atau Java.
- βSaat Anda ingin membatasi login hanya untuk domain Google Workspace tertentu.
Link skill
https://github.com/google/skills/blob/main/skills/identity/sign-in-with-google-web/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βTambahkan Sign In With Google ke aplikasi React saya dan verifikasi token login di server Node.js saya.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill ini merekomendasikan desain yang dimediasi backend jika memungkinkan, lalu menulis kode Google Identity Services dan pemeriksaan token di sisi server. Skill ini mencakup One Tap, FedCM, dan pembatasan domain.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum
Arsitektur apa yang direkomendasikan?
Pola yang dimediasi backend terlebih dahulu karena paling aman, dengan pola khusus klien sebagai cadangan.
Apakah mencakup framework?
Ya. Skill ini mencakup React, Next.js, Angular, dan HTML biasa.
Apakah memeriksa token di server?
Ya. Skill ini mencakup verifikasi ID token untuk backend Python, Node.js, Go, dan Java.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 22k
- Peringkat
- #10355
- Lisensi
- Apache-2.0
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
finding-google-skills
22kMembantu agent Anda menemukan panduan Google yang tepat untuk tugas pengaturan, seperti hosting, database, penyimpanan, login, atau penyajian model AI.
gcloud
22kMembantu agent Anda menulis dan memeriksa perintah gcloud Google Cloud, dengan mencari sintaks yang tepat sebelum menjalankan apa pun agar tidak menebak flag.
google-cloud-recipe-auth
22kMemandu agent Anda melalui identitas dan akses Google Cloud, termasuk cara orang dan layanan masuk serta izin apa yang mereka dapatkan.
google-cloud-recipe-onboarding
22kMemandu pengembang baru melalui langkah pertama di Google Cloud, termasuk memilih proyek, menautkan penagihan, dan men-deploy sumber daya pertama.
Skill serupa
reverse-engineer-anything
422kMembantu agent Anda memeriksa aplikasi dan paket yang sudah dirilis untuk menjelaskan fitur, membandingkan versi, atau memandu pembangunan ulang dengan alat REA.
1password
394kMembantu agent Anda mengatur CLI 1Password, masuk, serta membaca atau menyisipkan rahasia tanpa menampilkan nilainya di chat.
healthcheck
394kMembantu agent Anda mengaudit komputer atau server OpenClaw dari risiko keamanan seperti SSH, firewall, pembaruan, dan cadangan, lalu menyarankan perbaikan aman.