Skip to content
Content
Skill

/cognito-federation

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,

From plugin
webiny-js
8.1k79 skills3 MCP

Claude Code

$ npx -y skills add webiny/webiny-js --skill cognito-federation --agent claude-code

SKILL.md

cognito-federation.SKILL.md
name: webiny-cognito-federation
description: >
  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.

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 | | `providerDetails` | `object` | Yes | AWS Cognito provider details (client_id, client_secret, etc.) | | `attributeMapping` | `object` | No | Custom attribute mapping (overrides defaults) |

`CognitoSignInConfig.Interface` (Admin Customization)

| Method | Signature | Description | | ------------- | ----------------------- | ---------------------------------------------- | | `getConfig()` | `() => Promise<Config>` | Returns federation config for the login screen |

`CognitoSignInConfig.Config` (Return Type)

| Field | Type | Required | Description | | ----------------------- | ------------------------------

Read more
@webiny
Ships withwebiny-js

Open-source content platform. Self-hosted on AWS serverless. Built as a TypeScript framework you extend with code, not a closed product you configure through a UI. Runs on Lambda, DynamoDB, S3, and CloudFront inside your own AWS account. Scales automatically.

8.1k79 skills3 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
8.1k
Star history of webiny/webiny-js on GitHub, a chart by star-history.com

Other skills on webiny-js.

design-ask

design-ask

Turn open design questions into a paste-ready prompt for Claude Design, log them with Q-IDs and copy the prompt to the clipboard.…

@webiny@webinyInstall Skill
design-pull

design-pull

Pull a Claude Design project into a local, git-ignored design folder and keep a catalogue of what was pulled and implemented. Use…

@webiny@webinyInstall Skill
grill-me

grill-me

Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision…

@webiny@webinyInstall Skill
prd-to-plan

prd-to-plan

Turn a PRD into a multi-phase implementation plan using tracer-bullet vertical slices, saved as a local Markdown file in…

@webiny@webinyInstall Skill
preflight

preflight

Webiny-only. Run all checks required before packages are ready for publish: deps, build, lint, format, tests.

@webiny@webinyInstall Skill
tester

tester

Use when running tests. Shows how to run tests for a single package, including OpenSearch (ddb-os) tests when applicable.

@webiny@webinyInstall Skill

More skills from other plugins.

prompt-lookup

prompt-lookup

Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use…

@gh-f@gh-fInstall Skill
ppt-master

ppt-master

AI-driven presentation workflow for generating editable PPTX decks and slides, reconstructing page visuals, creating reusable…

@hugohe3@hugohe3Install Skill
morph-ppt

morph-ppt

Use this skill when the user wants a .pptx with smooth cross-slide animation — PowerPoint Morph transitions, Keynote-style…

@iofficeai@iofficeaiInstall Skill

Questions about cognito-federation.

Which coding agents can use cognito-federation?
cognito-federation installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.