webiny-cognito-federation
できること
このスキルは、Webinyプロジェクトの Cognitoのログインに外部のアイデンティティプロバイダーを追加するとき、AIを導きます。GoogleやEntra IDなどのプロバイダーでシングルサインオンをしたい開発者向けです。
使う場面
- ✓GoogleやFacebook、Apple、Amazonのアカウントで、Webinyプロジェクトにユーザーがサインインできるようにしたいとき。
- ✓OIDCを使って、Cognitoを会社のアイデンティティプロバイダーに接続したいとき。
- ✓フェデレーションのプロバイダー用に、管理画面のログイン画面をカスタマイズする必要があるとき。
スキルのリンク
https://github.com/webiny/webiny-js/blob/next/skills/user-skills/cognito-federation/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私たちのチームが、Cognito経由でGoogleアカウントを使ってWebiny管理画面にサインインできるようにしてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
スキルは、設定ファイルのCognito拡張にフェデレーションの設定を追加する方法を説明します。それによりインフラとログインボタンが設定され、フェデレーションされたユーザーはWebinyに自動で同期されます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)を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:
Infrastructure — The
federationprop on<Cognito />, under the hood, creates the Cognito User Pool Domain, Identity Provider resources, and configures OAuth on the User Pool Client.Admin Login Screen — The federation config is passed as an
Admin.BuildParamto the admin app. ACognitoSignInConfigabstraction provides the login screen with provider buttons, OAuth settings for Amplify, and credentials visibility. By default, this is auto-generated from thefederationprop. For advanced customization (IP whitelists, async logic), provide anadminConfigextension.API Identity — Federated tokens are auto-detected via the
identitiesJWT claim and markedexternal: true. TheExternalIdpUserSyncHandlerauto-creates/updates users on login. For custom role/team mapping, provide anapiConfigextension implementingCognitoIdpConfig.
How Federated Login Works
- User clicks a provider button on the login screen
signInWithRedirect()redirects to Cognito Hosted UI- Cognito redirects to the external IdP (Google, Entra ID, etc.)
- After authentication, Cognito creates an
idTokenwith anidentitiesclaim - The admin app picks up the session via
fetchAuthSession() - The API detects
identitiesin the token, setsexternal: true ExternalIdpUserSyncHandlercreates/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 |
よくある質問
Cognitoはユーザープールのままですか?
はい。スキルによると、外部のプロバイダーがサインインを扱う間も、Cognitoはユーザープールのままです。
どのプロバイダーが挙げられていますか?
Google、Facebook、Apple、Amazon、そしてEntra IDなどのOIDCプロバイダーです。
ログインの動作はカスタマイズできますか?
はい。アイデンティティのマッピングとログイン画面のための、任意のAPIと管理画面の設定を通じてできます。
詳細
作者による元の説明
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
人気
- GitHubのスター
- 8.1k
- ランキング
- #12594
- ライセンス
- —
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
prd-to-plan
8.1k製品要件書を、それぞれ端から端まで成立する小さなスライスの段階的な計画に変え、Markdownファイルとして保存するよう、エージェントを支援します。
webiny-admin-architect
8.1kビジネスロジックの層とプレゼンターのパターンを使い、Webinyプラットフォームの管理画面を作る方法をエージェントに教えます。
webiny-admin-permissions
8.1k自動生成される権限フォームや、表示・非表示のチェックを含め、Webinyの管理画面に権限の制御を追加するよう、エージェントに教えます。
webiny-form-model
8.1kビルダーで宣言的にフィールドを定義し、レイアウト、検証、条件付きのルールを使って、Webinyのフォームを作るよう、エージェントに教えます。
似ているスキル
reverse-engineer-anything
422kREAツールを使って、出荷済みのアプリやパッケージの中身を調べ、機能の説明、版の比較、再構築の手順をエージェントが支援します。
1password
394k1Password CLIをセットアップし、サインインして、秘密情報の値を会話に表示せずに読み取ったり注入したりするようエージェントを支援します。
healthcheck
394kOpenClawを動かすコンピューターやサーバーを、SSH、ファイアウォール、更新、バックアップなどのセキュリティリスクについて監査し、安全な修正案を提案するようエージェントを支援します。