[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75MB3E0VPCPBTQCSAX67BTX":3,"skill-same:01M75MB3E0VPCPBTQCSAX67BTX":92},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M75MB3E0VPCPBTQCSAX67BTX","aws-auth",null,"Adds user authentication to web and mobile apps with Amazon Cognito (user pools and identity pools) and the AWS Amplify client auth libraries. Covers sign-up\u002Fsign-in flows and the login page (Cognito-hosted UI \u002F managed login), MFA, password policies, OAuth 2.0 \u002F OIDC flows (auth-code + PKCE, client credentials), social\u002FSAML federation, tokens (ID\u002Faccess\u002Frefresh, rotation, revocation, storage), Cognito Lambda triggers, identity pools (temp AWS creds), and gating API Gateway (or ALB) routes to signed-in users via Cognito\u002FJWT authorizers. Applies when adding a login or sign-up page, configuring a user pool or app client, choosing user pool vs identity pool, wiring social\u002FSAML, refreshing tokens, requiring sign-in on an API Gateway or ALB, or debugging redirect_uri\u002Ftoken\u002FMFA\u002FCORS\u002Ffederation errors. Does NOT cover Amplify Gen2 backend definitions (defineAuth, npx ampx → aws-amplify), IAM\u002FSTS\u002FIdentity Center (→ aws-iam), or API Gateway\u002FLambda resource config beyond the authorizer (→ aws-serverless).","jkomyno\u002F.dotfiles","jkomyno","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F12381818?v=4","01M75MA8EK2FJFP0274GEB1RNB","Alberto Schiabel","01M75MA8FKQN5GTW089WN3838D",5,"MIT","https:\u002F\u002Fgithub.com\u002Fjkomyno\u002F.dotfiles\u002Fblob\u002Fmain\u002Ftarget\u002Fhome\u002F.agents\u002Fskills\u002Faws-auth\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: aws-auth\ndescription: >-\n  Adds user authentication to web and mobile apps with Amazon Cognito (user pools\n  and identity pools) and the AWS Amplify client auth libraries. Covers sign-up\u002Fsign-in\n  flows and the login page (Cognito-hosted UI \u002F managed login), MFA, password policies,\n  OAuth 2.0 \u002F OIDC flows (auth-code + PKCE, client credentials), social\u002FSAML federation,\n  tokens (ID\u002Faccess\u002Frefresh, rotation, revocation, storage), Cognito Lambda triggers,\n  identity pools (temp AWS creds), and gating API Gateway (or ALB) routes to signed-in\n  users via Cognito\u002FJWT authorizers. Applies when adding a login or sign-up page,\n  configuring a user pool or app client, choosing user pool vs identity pool, wiring\n  social\u002FSAML, refreshing tokens, requiring sign-in on an API Gateway or ALB, or debugging\n  redirect_uri\u002Ftoken\u002FMFA\u002FCORS\u002Ffederation errors. Does NOT cover Amplify Gen2 backend\n  definitions (defineAuth, npx ampx → aws-amplify), IAM\u002FSTS\u002FIdentity Center (→ aws-iam),\n  or API Gateway\u002FLambda resource config beyond the authorizer (→ aws-serverless).\nversion: 1\n---\n\n# AWS Auth (Amazon Cognito)\n\nApplication-level user authentication and authorization with Amazon Cognito and the Amplify\nclient auth libraries. Verify specific limits, quotas, and exact API shapes against official AWS\ndocumentation when precision matters; trust the docs over memory when they conflict.\n\n**Recommended:** The AWS MCP server provides streamlined access to the AWS APIs used in this skill (Cognito user pool\u002Fapp client\u002Fidentity pool setup, API Gateway authorizers). If it is unavailable, the AWS CLI commands shown throughout work directly — the skill has no hard dependency on MCP.\n\n**When NOT to use:** Amplify Gen2 backend code (`defineAuth`, `amplify\u002Fauth.ts`, `npx ampx`); IAM\npolicy\u002Frole\u002Ftrust-policy authoring, STS, or IAM Identity Center console SSO; API Gateway\nroute\u002Fintegration setup or Lambda function implementation (this skill covers only the Cognito\u002FJWT\nauthorizer configuration and the purpose of Cognito Lambda triggers).\n\n## User Pool vs Identity Pool — pick first\n\nThese are different services that are frequently confused. Most apps need a **user pool**; add an\n**identity pool only if** the client must call AWS services directly.\n\n| You need... | Use | Why |\n|-------------|-----|-----|\n| Sign-up \u002F sign-in, user directory, issue JWTs | **User pool** | It authenticates users and is an OIDC IdP |\n| The signed-in client to call S3\u002FDynamoDB\u002Fetc. directly with AWS credentials | **Identity pool** | It exchanges a token for temporary AWS credentials via STS |\n| Both (sign in, then hit AWS resources from the browser\u002Fapp) | User pool → identity pool | Identity pool trusts the user pool as its IdP |\n\nIf your app only calls your own backend\u002FAPI, you do **not** need an identity pool — send the user\npool token to your API. See [identity-pools.md](references\u002Fidentity-pools.md).\n\n## Critical Warnings\n\n**`update-user-pool-client` and `set-identity-pool-roles` are FULL REPLACE, not partial updates**: Any field you omit is reset to its default — calling `update-user-pool-client` with only the fields you want to change silently wipes `ExplicitAuthFlows`, token validity, `EnableTokenRevocation`, refresh-token rotation, and read\u002Fwrite attributes; `set-identity-pool-roles` likewise replaces the whole roles + `RoleMappings` structure. **Always read-modify-write**: `describe-user-pool-client` (or `get-identity-pool-roles`) first, then re-send every existing field plus your change. In an agent context the wipe is invisible — the call succeeds and only breaks later when a user hits the missing flow. See [managed-login-oauth.md](references\u002Fmanaged-login-oauth.md) and [identity-pools.md](references\u002Fidentity-pools.md).\n\n**Don't use the implicit grant for new apps**: The implicit grant (`response_type=token`) is legacy and returns tokens in the URL fragment. Use the **authorization code grant with PKCE** (`response_type=code` + `code_challenge`) for SPAs and mobile — public clients, no client secret. See [managed-login-oauth.md](references\u002Fmanaged-login-oauth.md).\n\n**Don't store refresh tokens in localStorage for high-value apps**: `localStorage` is readable by any injected script (XSS). The Amplify client library defaults to `localStorage`; switch to `cookieStorage`, keep refresh-token lifetime short, and enable **refresh token rotation** + **token revocation** on the app client. See [tokens-and-sessions.md](references\u002Ftokens-and-sessions.md).\n\n**Access-token claim customization needs a paid feature plan**: The pre token generation trigger customizes the **ID token** on the entry-level plan (V1), but customizing the **access token** (V2\u002FV3) requires a **paid feature plan** — check the [Cognito feature plans documentation](https:\u002F\u002Fdocs.aws.amazon.com\u002Fcognito\u002Flatest\u002Fdeveloperguide\u002Fcognito-sign-in-feature-plans.html) for which plan currently includes this, as plan names and inclusions can change. Don't assume access-token claims work on the entry-level plan. See [lambda-triggers.md](references\u002Flambda-triggers.md).\n\n**App client secret + SPA = broken auth**: A public client (browser\u002Fmobile) must have **no client secret**. If a secret is set, token calls fail unless a `SECRET_HASH` is sent, which a browser cannot protect. Generate a secret only for confidential (server-side) clients.\n\n**Don't bulk `admin-confirm-sign-up` UNCONFIRMED users**: When users are stuck `UNCONFIRMED`, prefer `resend-confirmation-code` so each user re-verifies via `confirm-sign-up` and proves email ownership (the code likely expired or went to spam). `admin-confirm-sign-up` flips the status instantly but confirms the account **without verifying the email** — the attribute stays unverified, which is dangerous when email drives password reset or account linking. Reserve it for trusted\u002Fmigrated accounts. See [troubleshooting.md](references\u002Ftroubleshooting.md).\n\n## Quick Navigation\n\n| You want to... | Go to |\n|----------------|-------|\n| Create a user pool, sign-up\u002Fsign-in, MFA, password policy, app clients | [user-pools.md](references\u002Fuser-pools.md) |\n| Add hosted UI \u002F managed login, OAuth flows, social or SAML login, callback URLs, **custom domain (ACM in us-east-1)** | [managed-login-oauth.md](references\u002Fmanaged-login-oauth.md) |\n| Handle ID\u002Faccess\u002Frefresh tokens, rotation, revocation, **session termination (global sign-out vs revoke vs disable)** | [tokens-and-sessions.md](references\u002Ftokens-and-sessions.md) |\n| Give the client temporary AWS credentials, guest access, role mapping | [identity-pools.md](references\u002Fidentity-pools.md) |\n| Protect an API Gateway API with Cognito tokens (**and enforce custom claims in the backend**) | [api-authorization.md](references\u002Fapi-authorization.md) |\n| Add Cognito login in front of an Application Load Balancer (ALB `authenticate-cognito`) | [api-authorization.md](references\u002Fapi-authorization.md) |\n| Machine-to-machine (client credentials) auth, resource servers, custom scopes | [managed-login-oauth.md](references\u002Fmanaged-login-oauth.md) |\n| Create user pool groups and add users to them (`cognito:groups`, `Precedence`) | [user-pools.md](references\u002Fuser-pools.md) |\n| Customize claims, custom auth challenge flows, migrate users, validate sign-up | [lambda-triggers.md](references\u002Flambda-triggers.md) |\n| Add **passkey \u002F WebAuthn** sign-in (`USER_AUTH` flow, `AllowedFirstAuthFactors`, WebAuthn enrollment) | [passkeys.md](references\u002Fpasskeys.md) |\n| Configure **threat protection** — compromised-credentials block, adaptive auth (risk-based MFA), log delivery to CloudWatch | [threat-protection.md](references\u002Fthreat-protection.md) |\n| Something is broken (redirect, token, MFA, CORS, social login) | [troubleshooting.md](references\u002Ftroubleshooting.md) |\n\n## Common Workflows\n\n**\"Add sign-up and login to my React app\"** → Create a user pool + a public app client (no secret), enable the hosted UI \u002F managed login with the authorization code grant with PKCE, wire the Amplify client library. See [user-pools.md](references\u002Fuser-pools.md) and [managed-login-oauth.md](references\u002Fmanaged-login-oauth.md).\n\n**\"Add Google \u002F social login\"** → Register the social IdP on the user pool, map attributes, add the provider to the app client and hosted UI. See [managed-login-oauth.md](references\u002Fmanaged-login-oauth.md).\n\n**\"Only authenticated users should call my API\"** → HTTP API → JWT authorizer; REST API → Cognito user pools authorizer. See [api-authorization.md](references\u002Fapi-authorization.md).\n\n**\"Let the browser upload to S3 after login\"** → User pool for sign-in, then an identity pool to vend scoped temporary credentials. See [identity-pools.md](references\u002Fidentity-pools.md).\n\n## Troubleshooting\n\n| Error\u002FSymptom | Likely Cause | Quick Fix |\n|---------------|-------------|-----------|\n| `redirect_mismatch` \u002F redirect to wrong URL after login | Callback URL not registered, or scheme\u002Ftrailing-slash\u002Fcase differs | Add the exact callback URL (incl. scheme and path) to the app client's Allowed callback URLs |\n| Token calls fail with \"unable to verify secret hash\" | Client secret set on a public (SPA\u002Fmobile) client | Recreate the app client with no secret, or send `SECRET_HASH` from a confidential client |\n| Users get 401 from API Gateway with a valid token | Wrong token type or audience\u002Fissuer mismatch | HTTP JWT authorizer: issuer `https:\u002F\u002Fcognito-idp.{region}.amazonaws.com\u002F{userPoolId}`, audience = app client id; send the token the authorizer expects |\n| CORS errors calling the hosted UI \u002F token endpoint | Browser calling `\u002Foauth2\u002Ftoken` cross-origin, or missing CORS on your API | Do the code exchange with PKCE; don't proxy the token endpoint from the browser |\n| Social login user \"already exists\" \u002F attribute conflict | Same email across providers creates separate users | Enable attribute mapping + account linking; treat email as non-unique across IdPs |\n\nFull tables in [troubleshooting.md](references\u002Ftroubleshooting.md).\n\n## Security Considerations\n\n- Public clients (SPA\u002Fmobile): **no client secret**, authorization code grant **with PKCE**, request least-privilege scopes.\n- Enable **MFA** (TOTP or SMS), a strong password policy, and **advanced security \u002F threat protection** where available.\n- Short access-token lifetime; enable **refresh token rotation** and **token revocation**; prefer `cookieStorage` over `localStorage`.\n- Identity pools: scope the authenticated IAM role tightly; disable unauthenticated (guest) access unless required.\n- Validate JWTs against the user pool JWKS (`iss`, `aud`\u002F`client_id`, `token_use`, `exp`) on every protected request. Use a maintained library such as [`aws-jwt-verify`](https:\u002F\u002Fgithub.com\u002Fawslabs\u002Faws-jwt-verify) rather than hand-rolling verification.\n- Set security headers on the app's web pages: `Content-Security-Policy` (restrict script sources to mitigate token-stealing XSS), `Strict-Transport-Security` (HSTS), `X-Frame-Options`\u002F`frame-ancestors` (clickjacking on login pages), and `X-Content-Type-Options: nosniff`.\n- Enable logging and monitoring: CloudTrail for Cognito API events (sign-up\u002Fsign-in\u002Fadmin), user pool threat protection (adaptive auth + event logging), CloudWatch alarms on failed\u002Fthrottled auth, and API Gateway access logging for authorizer decisions.\n- All Cognito and API endpoints are HTTPS\u002FTLS only; enable encryption at rest with a customer-managed KMS key (and restricted key access) on CloudWatch Log groups, SNS topics used for MFA\u002Fnotifications, and any identity-pool-fronted upload buckets.\n- If using SNS for MFA\u002Fnotification delivery, enable server-side encryption (KMS) on the topic, and keep SMS\u002Femail message content limited to what the recipient needs — don't include more PII than the message requires.\n- References: [Amazon Cognito security features (user pools)](https:\u002F\u002Fdocs.aws.amazon.com\u002Fcognito\u002Flatest\u002Fdeveloperguide\u002Fmanaging-security.html), [Amazon Cognito security (top-level, incl. identity pools)](https:\u002F\u002Fdocs.aws.amazon.com\u002Fcognito\u002Flatest\u002Fdeveloperguide\u002Fsecurity.html), and [IAM\u002FSTS best practices](https:\u002F\u002Fdocs.aws.amazon.com\u002FIAM\u002Flatest\u002FUserGuide\u002Fbest-practices.html).\n\n## Where to Look When This Skill Is Silent\n\nWhen you need depth beyond this skill — exact parameter shapes, current limits, edge behaviors — fall back to the authoritative AWS sources rather than guessing. Pointers age much slower than content, so this map stays useful without the skill having to grow.\n\n- **API reference (exact params, defaults, errors):** [Cognito User Pools API](https:\u002F\u002Fdocs.aws.amazon.com\u002Fcognito-user-identity-pools\u002Flatest\u002FAPIReference\u002F) and [Cognito Identity API](https:\u002F\u002Fdocs.aws.amazon.com\u002Fcognitoidentity\u002Flatest\u002FAPIReference\u002F)\n- **Developer Guide (concepts, workflows):** [Amazon Cognito Developer Guide](https:\u002F\u002Fdocs.aws.amazon.com\u002Fcognito\u002Flatest\u002Fdeveloperguide\u002F)\n- **Quotas, rate limits, session-cookie lifetime:** [Cognito quotas](https:\u002F\u002Fdocs.aws.amazon.com\u002Fcognito\u002Flatest\u002Fdeveloperguide\u002Flimits.html)\n- **Feature plans \u002F tier gating:** [Cognito feature plans](https:\u002F\u002Fdocs.aws.amazon.com\u002Fcognito\u002Flatest\u002Fdeveloperguide\u002Fcognito-sign-in-feature-plans.html)\n- **Pricing:** [Amazon Cognito pricing](https:\u002F\u002Faws.amazon.com\u002Fcognito\u002Fpricing\u002F)\n- **CLI reference:** [aws cognito-idp](https:\u002F\u002Fdocs.aws.amazon.com\u002Fcli\u002Flatest\u002Freference\u002Fcognito-idp\u002F) and [aws cognito-identity](https:\u002F\u002Fdocs.aws.amazon.com\u002Fcli\u002Flatest\u002Freference\u002Fcognito-identity\u002F)\n\n## Not Covered By This Skill\n\n- **Amplify Gen2 backend** (`defineAuth`, `amplify\u002Fauth.ts`, `npx ampx sandbox`).\n- **IAM policy\u002Frole\u002Ftrust-policy authoring, STS, IAM Identity Center console SSO.**\n- **API Gateway route\u002Fintegration setup and Lambda function implementation** (this skill covers only the Cognito\u002FJWT authorizer configuration and the purpose of Cognito Lambda triggers).\n","# AWS Auth (Amazon Cognito)\n\nApplication-level user authentication and authorization with Amazon Cognito and the Amplify\nclient auth libraries. Verify specific limits, quotas, and exact API shapes against official AWS\ndocumentation when precision matters; trust the docs over memory when they conflict.\n\n**Recommended:** The AWS MCP server provides streamlined access to the AWS APIs used in this skill (Cognito user pool\u002Fapp client\u002Fidentity pool setup, API Gateway authorizers). If it is unavailable, the AWS CLI commands shown throughout work directly — the skill has no hard dependency on MCP.\n\n**When NOT to use:** Amplify Gen2 backend code (`defineAuth`, `amplify\u002Fauth.ts`, `npx ampx`); IAM\npolicy\u002Frole\u002Ftrust-policy authoring, STS, or IAM Identity Center console SSO; API Gateway\nroute\u002Fintegration setup or Lambda function implementation (this skill covers only the Cognito\u002FJWT\nauthorizer configuration and the purpose of Cognito Lambda triggers).\n\n## User Pool vs Identity Pool — pick first\n\nThese are different services that are frequently confused. Most apps need a **user pool**; add an\n**identity pool only if** the client must call AWS services directly.\n\n| You need... | Use | Why |\n|-------------|-----|-----|\n| Sign-up \u002F sign-in, user directory, issue JWTs | **User pool** | It authenticates users and is an OIDC IdP |\n| The signed-in client to call S3\u002FDynamoDB\u002Fetc. directly with AWS credentials | **Identity pool** | It exchanges a token for temporary AWS credentials via STS |\n| Both (sign in, then hit AWS resources from the browser\u002Fapp) | User pool → identity pool | Identity pool trusts the user pool as its IdP |\n\nIf your app only calls your own backend\u002FAPI, you do **not** need an identity pool — send the user\npool token to your API. See [identity-pools.md](references\u002Fidentity-pools.md).\n\n## Critical Warnings\n\n**`update-user-pool-client` and `set-identity-pool-roles` are FULL REPLACE, not partial updates**: Any field you omit is reset to its default — calling `update-user-pool-client` with only the fields you want to change silently wipes `ExplicitAuthFlows`, token validity, `EnableTokenRevocation`, refresh-token rotation, and read\u002Fwrite attributes; `set-identity-pool-roles` likewise replaces the whole roles + `RoleMappings` structure. **Always read-modify-write**: `describe-user-pool-client` (or `get-identity-pool-roles`) first, then re-send every existing field plus your change. In an agent context the wipe is invisible — the call succeeds and only breaks later when a user hits the missing flow. See [managed-login-oauth.md](references\u002Fmanaged-login-oauth.md) and [identity-pools.md](references\u002Fidentity-pools.md).\n\n**Don't use the implicit grant for new apps**: The implicit grant (`response_type=token`) is legacy and returns tokens in the URL fragment. Use the **authorization code grant with PKCE** (`response_type=code` + `code_challenge`) for SPAs and mobile — public clients, no client secret. See [managed-login-oauth.md](references\u002Fmanaged-login-oauth.md).\n\n**Don't store refresh tokens in localStorage for high-value apps**: `localStorage` is readable by any injected script (XSS). The Amplify client library defaults to `localStorage`; switch to `cookieStorage`, keep refresh-token lifetime short, and enable **refresh token rotation** + **token revocation** on the app client. See [tokens-and-sessions.md](references\u002Ftokens-and-sessions.md).\n\n**Access-token claim customization needs a paid feature plan**: The pre token generation trigger customizes the **ID token** on the entry-level plan (V1), but customizing the **access token** (V2\u002FV3) requires a **paid feature plan** — check the [Cognito feature plans documentation](https:\u002F\u002Fdocs.aws.amazon.com\u002Fcognito\u002Flatest\u002Fdeveloperguide\u002Fcognito-sign-in-feature-plans.html) for which plan currently includes this, as plan names and inclusions can change. Don't assume access-token claims work on the entry-level plan. See [lambda-triggers.md](references\u002Flambda-triggers.md).\n\n**App client secret + SPA = broken auth**: A public client (browser\u002Fmobile) must have **no client secret**. If a secret is set, token calls fail unless a `SECRET_HASH` is sent, which a browser cannot protect. Generate a secret only for confidential (server-side) clients.\n\n**Don't bulk `admin-confirm-sign-up` UNCONFIRMED users**: When users are stuck `UNCONFIRMED`, prefer `resend-confirmation-code` so each user re-verifies via `confirm-sign-up` and proves email ownership (the code likely expired or went to spam). `admin-confirm-sign-up` flips the status instantly but confirms the account **without verifying the email** — the attribute stays unverified, which is dangerous when email drives password reset or account linking. Reserve it for trusted\u002Fmigrated accounts. See [troubleshooting.md](references\u002Ftroubleshooting.md).\n\n## Quick Navigation\n\n| You want to... | Go to |\n|----------------|-------|\n| Create a user pool, sign-up\u002Fsign-in, MFA, password policy, app clients | [user-pools.md](references\u002Fuser-pools.md) |\n| Add hosted UI \u002F managed login, OAuth flows, social or SAML login, callback URLs, **custom domain (ACM in us-east-1)** | [managed-login-oauth.md](references\u002Fmanaged-login-oauth.md) |\n| Handle ID\u002Faccess\u002Frefresh tokens, rotation, revocation, **session termination (global sign-out vs revoke vs disable)** | [tokens-and-sessions.md](references\u002Ftokens-and-sessions.md) |\n| Give the client temporary AWS credentials, guest access, role mapping | [identity-pools.md](references\u002Fidentity-pools.md) |\n| Protect an API Gateway API with Cognito tokens (**and enforce custom claims in the backend**) | [api-authorization.md](references\u002Fapi-authorization.md) |\n| Add Cognito login in front of an Application Load Balancer (ALB `authenticate-cognito`) | [api-authorization.md](references\u002Fapi-authorization.md) |\n| Machine-to-machine (client credentials) auth, resource servers, custom scopes | [managed-login-oauth.md](references\u002Fmanaged-login-oauth.md) |\n| Create user pool groups and add users to them (`cognito:groups`, `Precedence`) | [user-pools.md](references\u002Fuser-pools.md) |\n| Customize claims, custom auth challenge flows, migrate users, validate sign-up | [lambda-triggers.md](references\u002Flambda-triggers.md) |\n| Add **passkey \u002F WebAuthn** sign-in (`USER_AUTH` flow, `AllowedFirstAuthFactors`, WebAuthn enrollment) | [passkeys.md](references\u002Fpasskeys.md) |\n| Configure **threat protection** — compromised-credentials block, adaptive auth (risk-based MFA), log delivery to CloudWatch | [threat-protection.md](references\u002Fthreat-protection.md) |\n| Something is broken (redirect, token, MFA, CORS, social login) | [troubleshooting.md](references\u002Ftroubleshooting.md) |\n\n## Common Workflows\n\n**\"Add sign-up and login to my React app\"** → Create a user pool + a public app client (no secret), enable the hosted UI \u002F managed login with the authorization code grant with PKCE, wire the Amplify client library. See [user-pools.md](references\u002Fuser-pools.md) and [managed-login-oauth.md](references\u002Fmanaged-login-oauth.md).\n\n**\"Add Google \u002F social login\"** → Register the social IdP on the user pool, map attributes, add the provider to the app client and hosted UI. See [managed-login-oauth.md](references\u002Fmanaged-login-oauth.md).\n\n**\"Only authenticated users should call my API\"** → HTTP API → JWT authorizer; REST API → Cognito user pools authorizer. See [api-authorization.md](references\u002Fapi-authorization.md).\n\n**\"Let the browser upload to S3 after login\"** → User pool for sign-in, then an identity pool to vend scoped temporary credentials. See [identity-pools.md](references\u002Fidentity-pools.md).\n\n## Troubleshooting\n\n| Error\u002FSymptom | Likely Cause | Quick Fix |\n|---------------|-------------|-----------|\n| `redirect_mismatch` \u002F redirect to wrong URL after login | Callback URL not registered, or scheme\u002Ftrailing-slash\u002Fcase differs | Add the exact callback URL (incl. scheme and path) to the app client's Allowed callback URLs |\n| Token calls fail with \"unable to verify secret hash\" | Client secret set on a public (SPA\u002Fmobile) client | Recreate the app client with no secret, or send `SECRET_HASH` from a confidential client |\n| Users get 401 from API Gateway with a valid token | Wrong token type or audience\u002Fissuer mismatch | HTTP JWT authorizer: issuer `https:\u002F\u002Fcognito-idp.{region}.amazonaws.com\u002F{userPoolId}`, audience = app client id; send the token the authorizer expects |\n| CORS errors calling the hosted UI \u002F token endpoint | Browser calling `\u002Foauth2\u002Ftoken` cross-origin, or missing CORS on your API | Do the code exchange with PKCE; don't proxy the token endpoint from the browser |\n| Social login user \"already exists\" \u002F attribute conflict | Same email across providers creates separate users | Enable attribute mapping + account linking; treat email as non-unique across IdPs |\n\nFull tables in [troubleshooting.md](references\u002Ftroubleshooting.md).\n\n## Security Considerations\n\n- Public clients (SPA\u002Fmobile): **no client secret**, authorization code grant **with PKCE**, request least-privilege scopes.\n- Enable **MFA** (TOTP or SMS), a strong password policy, and **advanced security \u002F threat protection** where available.\n- Short access-token lifetime; enable **refresh token rotation** and **token revocation**; prefer `cookieStorage` over `localStorage`.\n- Identity pools: scope the authenticated IAM role tightly; disable unauthenticated (guest) access unless required.\n- Validate JWTs against the user pool JWKS (`iss`, `aud`\u002F`client_id`, `token_use`, `exp`) on every protected request. Use a maintained library such as [`aws-jwt-verify`](https:\u002F\u002Fgithub.com\u002Fawslabs\u002Faws-jwt-verify) rather than hand-rolling verification.\n- Set security headers on the app's web pages: `Content-Security-Policy` (restrict script sources to mitigate token-stealing XSS), `Strict-Transport-Security` (HSTS), `X-Frame-Options`\u002F`frame-ancestors` (clickjacking on login pages), and `X-Content-Type-Options: nosniff`.\n- Enable logging and monitoring: CloudTrail for Cognito API events (sign-up\u002Fsign-in\u002Fadmin), user pool threat protection (adaptive auth + event logging), CloudWatch alarms on failed\u002Fthrottled auth, and API Gateway access logging for authorizer decisions.\n- All Cognito and API endpoints are HTTPS\u002FTLS only; enable encryption at rest with a customer-managed KMS key (and restricted key access) on CloudWatch Log groups, SNS topics used for MFA\u002Fnotifications, and any identity-pool-fronted upload buckets.\n- If using SNS for MFA\u002Fnotification delivery, enable server-side encryption (KMS) on the topic, and keep SMS\u002Femail message content limited to what the recipient needs — don't include more PII than the message requires.\n- References: [Amazon Cognito security features (user pools)](https:\u002F\u002Fdocs.aws.amazon.com\u002Fcognito\u002Flatest\u002Fdeveloperguide\u002Fmanaging-security.html), [Amazon Cognito security (top-level, incl. identity pools)](https:\u002F\u002Fdocs.aws.amazon.com\u002Fcognito\u002Flatest\u002Fdeveloperguide\u002Fsecurity.html), and [IAM\u002FSTS best practices](https:\u002F\u002Fdocs.aws.amazon.com\u002FIAM\u002Flatest\u002FUserGuide\u002Fbest-practices.html).\n\n## Where to Look When This Skill Is Silent\n\nWhen you need depth beyond this skill — exact parameter shapes, current limits, edge behaviors — fall back to the authoritative AWS sources rather than guessing. Pointers age much slower than content, so this map stays useful without the skill having to grow.\n\n- **API reference (exact params, defaults, errors):** [Cognito User Pools API](https:\u002F\u002Fdocs.aws.amazon.com\u002Fcognito-user-identity-pools\u002Flatest\u002FAPIReference\u002F) and [Cognito Identity API](https:\u002F\u002Fdocs.aws.amazon.com\u002Fcognitoidentity\u002Flatest\u002FAPIReference\u002F)\n- **Developer Guide (concepts, workflows):** [Amazon Cognito Developer Guide](https:\u002F\u002Fdocs.aws.amazon.com\u002Fcognito\u002Flatest\u002Fdeveloperguide\u002F)\n- **Quotas, rate limits, session-cookie lifetime:** [Cognito quotas](https:\u002F\u002Fdocs.aws.amazon.com\u002Fcognito\u002Flatest\u002Fdeveloperguide\u002Flimits.html)\n- **Feature plans \u002F tier gating:** [Cognito feature plans](https:\u002F\u002Fdocs.aws.amazon.com\u002Fcognito\u002Flatest\u002Fdeveloperguide\u002Fcognito-sign-in-feature-plans.html)\n- **Pricing:** [Amazon Cognito pricing](https:\u002F\u002Faws.amazon.com\u002Fcognito\u002Fpricing\u002F)\n- **CLI reference:** [aws cognito-idp](https:\u002F\u002Fdocs.aws.amazon.com\u002Fcli\u002Flatest\u002Freference\u002Fcognito-idp\u002F) and [aws cognito-identity](https:\u002F\u002Fdocs.aws.amazon.com\u002Fcli\u002Flatest\u002Freference\u002Fcognito-identity\u002F)\n\n## Not Covered By This Skill\n\n- **Amplify Gen2 backend** (`defineAuth`, `amplify\u002Fauth.ts`, `npx ampx sandbox`).\n- **IAM policy\u002Frole\u002Ftrust-policy authoring, STS, IAM Identity Center console SSO.**\n- **API Gateway route\u002Fintegration setup and Lambda function implementation** (this skill covers only the Cognito\u002FJWT authorizer configuration and the purpose of Cognito Lambda triggers).\n",{"name":5,"version":24,"description":7},1,"main","9e160012bf175f264279507807d206dbe17e9aac","target\u002Fhome\u002F.agents\u002Fskills\u002Faws-auth",3,"https:\u002F\u002Fgithub.com\u002Fjkomyno\u002F.dotfiles","https:\u002F\u002Fgithub.com\u002Fjkomyno","https:\u002F\u002Fjkomyno.dev","AX engineer working on agentic dev tools. Previously Senior SWE @prisma & mathematical optimisation @cvut. International tech speaker.","2026-11-14 21:45:28",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add jkomyno\u002F.dotfiles --skill aws-auth",{"tool":40,"command":41},"bunx","bunx skills add jkomyno\u002F.dotfiles --skill aws-auth",{"tool":43,"command":44},"pnpm","pnpm dlx skills add jkomyno\u002F.dotfiles --skill aws-auth","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjkomyno\u002F.dotfiles\u002Fblob\u002Fmain\u002Ftarget\u002Fhome\u002F.agents\u002Fskills\u002Faws-auth\u002FSKILL.md",true,[48,54,60,64,68,72,76,80,84,88],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},".aws-skill-metadata","OTHER","其他",18,"https:\u002F\u002Fgithub.com\u002Fjkomyno\u002F.dotfiles\u002Fblob\u002Fmain\u002Ftarget\u002Fhome\u002F.agents\u002Fskills\u002Faws-auth\u002F.aws-skill-metadata",{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fapi-authorization.md","REFERENCE","参考文档",5157,"https:\u002F\u002Fgithub.com\u002Fjkomyno\u002F.dotfiles\u002Fblob\u002Fmain\u002Ftarget\u002Fhome\u002F.agents\u002Fskills\u002Faws-auth\u002Freferences\u002Fapi-authorization.md",{"path":61,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002Fidentity-pools.md",5907,"https:\u002F\u002Fgithub.com\u002Fjkomyno\u002F.dotfiles\u002Fblob\u002Fmain\u002Ftarget\u002Fhome\u002F.agents\u002Fskills\u002Faws-auth\u002Freferences\u002Fidentity-pools.md",{"path":65,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":66,"sourceHtmlUrl":67},"references\u002Flambda-triggers.md",10121,"https:\u002F\u002Fgithub.com\u002Fjkomyno\u002F.dotfiles\u002Fblob\u002Fmain\u002Ftarget\u002Fhome\u002F.agents\u002Fskills\u002Faws-auth\u002Freferences\u002Flambda-triggers.md",{"path":69,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Fmanaged-login-oauth.md",15818,"https:\u002F\u002Fgithub.com\u002Fjkomyno\u002F.dotfiles\u002Fblob\u002Fmain\u002Ftarget\u002Fhome\u002F.agents\u002Fskills\u002Faws-auth\u002Freferences\u002Fmanaged-login-oauth.md",{"path":73,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":74,"sourceHtmlUrl":75},"references\u002Fpasskeys.md",5004,"https:\u002F\u002Fgithub.com\u002Fjkomyno\u002F.dotfiles\u002Fblob\u002Fmain\u002Ftarget\u002Fhome\u002F.agents\u002Fskills\u002Faws-auth\u002Freferences\u002Fpasskeys.md",{"path":77,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":78,"sourceHtmlUrl":79},"references\u002Fthreat-protection.md",6036,"https:\u002F\u002Fgithub.com\u002Fjkomyno\u002F.dotfiles\u002Fblob\u002Fmain\u002Ftarget\u002Fhome\u002F.agents\u002Fskills\u002Faws-auth\u002Freferences\u002Fthreat-protection.md",{"path":81,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":82,"sourceHtmlUrl":83},"references\u002Ftokens-and-sessions.md",11444,"https:\u002F\u002Fgithub.com\u002Fjkomyno\u002F.dotfiles\u002Fblob\u002Fmain\u002Ftarget\u002Fhome\u002F.agents\u002Fskills\u002Faws-auth\u002Freferences\u002Ftokens-and-sessions.md",{"path":85,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":86,"sourceHtmlUrl":87},"references\u002Ftroubleshooting.md",4717,"https:\u002F\u002Fgithub.com\u002Fjkomyno\u002F.dotfiles\u002Fblob\u002Fmain\u002Ftarget\u002Fhome\u002F.agents\u002Fskills\u002Faws-auth\u002Freferences\u002Ftroubleshooting.md",{"path":89,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":90,"sourceHtmlUrl":91},"references\u002Fuser-pools.md",8749,"https:\u002F\u002Fgithub.com\u002Fjkomyno\u002F.dotfiles\u002Fblob\u002Fmain\u002Ftarget\u002Fhome\u002F.agents\u002Fskills\u002Faws-auth\u002Freferences\u002Fuser-pools.md",[93,101,108,115,122,130],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":100},"01M7DY814SMBRJFBZF4NTY2ZCK","potetomode","Load pstack's poteto-mode workflow for concise responses, deliberate delegation, simple code, and verified work. Use when the user requests potetomode or \u002Fpotetomode.","https:\u002F\u002Fgithub.com\u002Fjkomyno\u002F.dotfiles\u002Fblob\u002Fmain\u002Ftarget\u002Fhome\u002F.agents\u002Fskills\u002Fpotetomode\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":100},"01M7DY7YG4V89VKPN5ZQ64EXAV","bro","Restate the last assistant message in plain, concise language using pstack's bro skill. Use when the user requests bro or \u002Fbro.","https:\u002F\u002Fgithub.com\u002Fjkomyno\u002F.dotfiles\u002Fblob\u002Fmain\u002Ftarget\u002Fhome\u002F.agents\u002Fskills\u002Fbro\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":19},"01M75MJWVSC460HY537YJ5W6MX","wayfinder","Plan a huge chunk of work (more than one agent session can hold) as a shared map of decision tickets on your issue tracker, and resolve them one at a time until the way to the destination is clear.","https:\u002F\u002Fgithub.com\u002Fjkomyno\u002F.dotfiles\u002Fblob\u002Fmain\u002Ftarget\u002Fhome\u002F.agents\u002Fskills\u002Fwayfinder\u002FSKILL.md",[],[],{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":19},"01M75MJSKK9BZGSTMZ308DM1HA","using-exe-dev","Operate exe.dev virtual machines. Use when the task mentions exe.dev, exe VMs, *.exe.xyz hosts, or exe.dev infrastructure.","https:\u002F\u002Fgithub.com\u002Fjkomyno\u002F.dotfiles\u002Fblob\u002Fmain\u002Ftarget\u002Fhome\u002F.agents\u002Fskills\u002Fusing-exe-dev\u002FSKILL.md",[],[],{"skillNo":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":126,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":19},"01M75MJNT911P56SE62DZSQTX8","unlazy","Prove substantial work complete with file-backed gates and runnable checks. Use for exhaustive completion, a Depth Tree, or a completion ledger.","https:\u002F\u002Fgithub.com\u002Fjkomyno\u002F.dotfiles\u002Fblob\u002Fmain\u002Ftarget\u002Fhome\u002F.agents\u002Fskills\u002Funlazy\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjkomyno\u002F.dotfiles\u002Fblob\u002Fmain\u002Ftarget\u002Fhome\u002F.agents\u002Fskills\u002Funlazy\u002FSKILL.md",[],[],{"skillNo":131,"name":132,"nameZh":6,"description":133,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":134,"categories":135,"keywords":136,"publishedAt":19},"01M75MJHN22B60A6BNT0W4H7NH","sync-skills","Sync vendored third-party skills against their upstream repositories, re-apply local patches, and flag new upstream skills. Invoke explicitly with \u002Fsync-skills.","https:\u002F\u002Fgithub.com\u002Fjkomyno\u002F.dotfiles\u002Fblob\u002Fmain\u002Ftarget\u002Fhome\u002F.agents\u002Fskills\u002Fsync-skills\u002FSKILL.md",[],[]]