Langsung ke konten
Skillpedia
Keamanan8.1k Β· #12594

webiny-cognito-federation

Fungsinya

Skill ini memandu AI Anda saat menambahkan penyedia identitas eksternal ke login Cognito proyek Webiny. Skill ini untuk developer yang menginginkan single sign-on dengan penyedia seperti Google atau Entra ID.

Kapan dipakai

  • βœ“Saat Anda ingin pengguna masuk ke proyek Webiny dengan Google, Facebook, Apple, atau Amazon.
  • βœ“Saat Anda ingin Cognito terhubung ke penyedia identitas perusahaan memakai OIDC.
  • βœ“Saat Anda perlu menyesuaikan layar login admin untuk penyedia terfederasi.

Link skill

https://github.com/webiny/webiny-js/blob/next/skills/user-skills/cognito-federation/SKILL.md

Salin 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

Gunakan skill ini untuk membantu saya: https://github.com/webiny/webiny-js/blob/next/skills/user-skills/cognito-federation/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBiarkan tim kami masuk ke admin Webiny dengan akun Google melalui Cognito.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skill ini menjelaskan cara menambahkan pengaturan federation pada ekstensi Cognito di file konfigurasi. Itu menyiapkan infrastruktur dan tombol login, dan pengguna terfederasi disinkronkan otomatis ke Webiny.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Cognito Federation

TL;DR

Webiny supports federated sign-in through Cognito β€” users authenticate via external identity providers (Google, Entra ID, etc.) while Cognito remains the user pool. Configure it by adding a federation prop to <Cognito /> in webiny.config.tsx. This handles both infrastructure (Cognito User Pool Domain, IdP resources, OAuth client) and the admin login screen (provider buttons, OAuth for Amplify). Federated users are auto-detected and synced into Webiny. For advanced use cases, provide apiConfig (custom identity mapping) and/or adminConfig (custom login screen behavior).

Pattern / Core Concept

Cognito Federation has three layers:

  1. Infrastructure β€” The federation prop on <Cognito />, under the hood, creates the Cognito User Pool Domain, Identity Provider resources, and configures OAuth on the User Pool Client.

  2. Admin Login Screen β€” The federation config is passed as an Admin.BuildParam to the admin app. A CognitoSignInConfig abstraction provides the login screen with provider buttons, OAuth settings for Amplify, and credentials visibility. By default, this is auto-generated from the federation prop. For advanced customization (IP whitelists, async logic), provide an adminConfig extension.

  3. API Identity β€” Federated tokens are auto-detected via the identities JWT claim and marked external: true. The ExternalIdpUserSyncHandler auto-creates/updates users on login. For custom role/team mapping, provide an apiConfig extension implementing CognitoIdpConfig.

How Federated Login Works

  1. User clicks a provider button on the login screen
  2. signInWithRedirect() redirects to Cognito Hosted UI
  3. Cognito redirects to the external IdP (Google, Entra ID, etc.)
  4. After authentication, Cognito creates an idToken with an identities claim
  5. The admin app picks up the session via fetchAuthSession()
  6. The API detects identities in the token, sets external: true
  7. ExternalIdpUserSyncHandler creates/updates the Webiny user with roles/teams

Reference Tables

<Cognito /> Props

Prop Type Description
federation object | () => Promise<object> Federation config (see below) β€” sync or async
mfa boolean Enable TOTP MFA for all users (default: false)
apiConfig string Path to API identity mapping extension
adminConfig string Path to Admin login customization extension

federation Object

Field Type Required Default Description
domain string Yes β€” Cognito User Pool domain prefix
callbackUrls string[] Yes β€” OAuth callback/redirect URLs
logoutUrls string[] No callbackUrls OAuth logout redirect URLs
responseType "code" | "token" No "code" OAuth response type
allowCredentialsLogin boolean No true Show email/password form
identityProviders array Yes β€” List of federated IdPs

identityProviders[] Items

Field Type Required Description
type "google" | "facebook" | "amazon" | "apple" | "oidc" Yes Provider type
name string No Custom provider name (required for OIDC)
label string Yes Button text on the login screen
`providerDeta
Pertanyaan umum

Apakah Cognito tetap menjadi user pool?

Ya. Skill ini menyatakan Cognito tetap menjadi user pool sementara penyedia eksternal menangani login.

Penyedia apa saja yang tercantum?

Google, Facebook, Apple, Amazon, dan penyedia OIDC seperti Entra ID.

Bisakah perilaku login disesuaikan?

Bisa, melalui konfigurasi API dan admin opsional untuk pemetaan identitas dan layar login.

Detail

Deskripsi asli dari pembuat

Configuring Cognito Federation for Webiny projects β€” federated sign-in via external identity providers (Google, Facebook, Apple, Amazon, OIDC/Entra ID) while keeping Cognito as the user pool. Use this skill when the developer asks about Cognito federation, SSO with Cognito, adding Google/Microsoft/OIDC login to Cognito, federated identity providers, CognitoSignInConfig, CognitoIdpConfig, external users, signInWithRedirect, OAuth redirect URLs, hiding the password form, allowCredentialsLogin, or customizing the federated login screen.

repo: webiny/webiny-js

Popularitas

Bintang GitHub
8.1k
Peringkat
#12594
Lisensi
β€”
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa