Skillpedia
الأمان8.1k · #12594

webiny-cognito-federation

ما الذي تفعله

ترشد هذه المهارة ذكاءك عند إضافة مزودي هوية خارجيين إلى تسجيل Cognito في مشروع Webiny. وهي لمطورين يريدون تسجيل دخول موحّد مع مزودين مثل Google أو Entra ID.

متى تستخدمها

  • ✓عندما تريد أن يدخل المستخدمون إلى مشروع Webiny بحساب Google أو Facebook أو Apple أو Amazon.
  • ✓عندما تريد أن يتصل Cognito بمزود هوية لشركة باستخدام OIDC.
  • ✓عندما تحتاج إلى تخصيص شاشة تسجيل الدخول في الإدارة لمزودين موحّدين.

رابط المهارة

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

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/webiny/webiny-js/blob/next/skills/user-skills/cognito-federation/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“اسمح لفريقنا بالدخول إلى إدارة Webiny بحسابات Google عبر Cognito.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

تشرح المهارة إضافة إعداد federation إلى امتداد 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:

  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
الأسئلة الشائعة

هل يبقى Cognito هو مجموعة المستخدمين؟

نعم. تقول المهارة إن Cognito يبقى مجموعة المستخدمين بينما يتولى المزودون الخارجيون تسجيل الدخول.

ما المزودون المذكورون؟

Google وFacebook وApple وAmazon ومزودو OIDC مثل Entra ID.

هل يمكن تخصيص سلوك تسجيل الدخول؟

نعم، عبر إعدادات اختيارية للـ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
الترخيص
—
آخر تحديث
2‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة