AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides guidance on integrating Amazon Cognito user pools and identity pools into web and mobile applications. It covers the full lifecycle of authentication, including sign-up/sign-in flows, managed login, MFA, OAuth 2.0/OIDC standards, and token management. It also details how to secure API Gateway or ALB routes using Cognito authorizers and how to vend temporary AWS credentials to clients via identity pools. The skill emphasizes secure practices, such as using PKCE for public clients and avoiding common pitfalls like client secret exposure or improper identity pool role configuration.
What it does
- Configures Amazon Cognito user pools for user directory and authentication management.
- Implements OAuth 2.0 and OIDC flows, including authorization code grant with PKCE.
- Secures API Gateway and ALB routes using Cognito/JWT authorizers.
- Manages identity pools to provide temporary AWS credentials to authenticated clients.
- Handles token lifecycle, including rotation, revocation, and secure storage.
- Integrates social and SAML federation for external identity providers.
When to use it
- When adding sign-up or login functionality to a web or mobile application.
- When you need to gate API endpoints to ensure only authenticated users can access them.
- When your client application requires direct access to AWS services like S3 or DynamoDB.
- When configuring MFA, password policies, or custom authentication challenges.
- When troubleshooting authentication errors like redirect mismatches, CORS issues, or token validation failures.
Advantages
- Provides clear distinctions between user pools and identity pools to prevent common architectural errors.
- Highlights critical security practices like avoiding client secrets in public clients.
- Includes specific guidance on avoiding destructive 'full replace' API calls.
- Offers a structured approach to troubleshooting common authentication and federation issues.
- Aligns with industry-standard security patterns for token handling and API protection.
Usage examples
- “How do I set up a user pool for a React app with hosted UI?”
- The agent provides steps to create a user pool, configure a public app client, enable the hosted UI with authorization code grant and PKCE, and wire the Amplify client library.
- “My API Gateway is returning 401 errors for valid tokens, what should I check?”
- The agent guides you to verify the token type, check the issuer and audience configuration in the JWT authorizer, and ensure the correct token is being sent in the Authorization header.
- “How do I allow my mobile app users to upload files directly to S3?”
- The agent explains how to set up an identity pool that trusts your user pool, maps authenticated users to an IAM role with S3 permissions, and vends temporary credentials.
- “How do I add Google login to my Cognito user pool?”
- The agent outlines the process of registering Google as an IdP in the user pool, mapping attributes, and updating the app client to include the provider.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/aws/aws-auth/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip aws-auth.zip -d .agents/skills
Documentation by AWS
AWS Auth (Amazon Cognito)
Application-level user authentication and authorization with Amazon Cognito and the Amplify client auth libraries. Verify specific limits, quotas, and exact API shapes against official AWS documentation when precision matters; trust the docs over memory when they conflict.
Recommended: The AWS MCP server provides streamlined access to the AWS APIs used in this skill (Cognito user pool/app client/identity 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.
When NOT to use: Amplify Gen2 backend code (defineAuth, amplify/auth.ts, npx ampx); IAM
policy/role/trust-policy authoring, STS, or IAM Identity Center console SSO; API Gateway
route/integration setup or Lambda function implementation (this skill covers only the Cognito/JWT
authorizer configuration and the purpose of Cognito Lambda triggers).
User Pool vs Identity Pool — pick first
These are different services that are frequently confused. Most apps need a user pool; add an identity pool only if the client must call AWS services directly.
| You need... | Use | Why |
|---|---|---|
| Sign-up / sign-in, user directory, issue JWTs | User pool | It authenticates users and is an OIDC IdP |
| The signed-in client to call S3/DynamoDB/etc. directly with AWS credentials | Identity pool | It exchanges a token for temporary AWS credentials via STS |
| Both (sign in, then hit AWS resources from the browser/app) | User pool → identity pool | Identity pool trusts the user pool as its IdP |
If your app only calls your own backend/API, you do not need an identity pool — send the user pool token to your API. See identity-pools.md.
Critical Warnings
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/write 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 and identity-pools.md.
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.
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.
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/V3) requires a paid feature plan — check the Cognito feature plans documentation 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.
App client secret + SPA = broken auth: A public client (browser/mobile) 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.
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/migrated accounts. See troubleshooting.md.
Quick Navigation
| You want to... | Go to |
|---|---|
| Create a user pool, sign-up/sign-in, MFA, password policy, app clients | user-pools.md |
| Add hosted UI / managed login, OAuth flows, social or SAML login, callback URLs, custom domain (ACM in us-east-1) | managed-login-oauth.md |
| Handle ID/access/refresh tokens, rotation, revocation, session termination (global sign-out vs revoke vs disable) | tokens-and-sessions.md |
| Give the client temporary AWS credentials, guest access, role mapping | identity-pools.md |
| Protect an API Gateway API with Cognito tokens (and enforce custom claims in the backend) | api-authorization.md |
Add Cognito login in front of an Application Load Balancer (ALB authenticate-cognito) | api-authorization.md |
| Machine-to-machine (client credentials) auth, resource servers, custom scopes | managed-login-oauth.md |
Create user pool groups and add users to them (cognito:groups, Precedence) | user-pools.md |
| Customize claims, custom auth challenge flows, migrate users, validate sign-up | lambda-triggers.md |
Add passkey / WebAuthn sign-in (USER_AUTH flow, AllowedFirstAuthFactors, WebAuthn enrollment) | passkeys.md |
| Configure threat protection — compromised-credentials block, adaptive auth (risk-based MFA), log delivery to CloudWatch | threat-protection.md |
| Something is broken (redirect, token, MFA, CORS, social login) | troubleshooting.md |
Common Workflows
"Add sign-up and login to my React app" → Create a user pool + a public app client (no secret), enable the hosted UI / managed login with the authorization code grant with PKCE, wire the Amplify client library. See user-pools.md and managed-login-oauth.md.
"Add Google / 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.
"Only authenticated users should call my API" → HTTP API → JWT authorizer; REST API → Cognito user pools authorizer. See api-authorization.md.
"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.
Troubleshooting
| Error/Symptom | Likely Cause | Quick Fix |
|---|---|---|
redirect_mismatch / redirect to wrong URL after login | Callback URL not registered, or scheme/trailing-slash/case differs | Add the exact callback URL (incl. scheme and path) to the app client's Allowed callback URLs |
| Token calls fail with "unable to verify secret hash" | Client secret set on a public (SPA/mobile) client | Recreate the app client with no secret, or send SECRET_HASH from a confidential client |
| Users get 401 from API Gateway with a valid token | Wrong token type or audience/issuer mismatch | HTTP JWT authorizer: issuer https://cognito-idp.{region}.amazonaws.com/{userPoolId}, audience = app client id; send the token the authorizer expects |
| CORS errors calling the hosted UI / token endpoint | Browser calling /oauth2/token cross-origin, or missing CORS on your API | Do the code exchange with PKCE; don't proxy the token endpoint from the browser |
| Social login user "already exists" / attribute conflict | Same email across providers creates separate users | Enable attribute mapping + account linking; treat email as non-unique across IdPs |
Full tables in troubleshooting.md.
Security Considerations
Public clients (SPA/mobile): no client secret, authorization code grant with PKCE, request least-privilege scopes.
Enable MFA (TOTP or SMS), a strong password policy, and advanced security / threat protection where available.
Short access-token lifetime; enable refresh token rotation and token revocation; prefer
cookieStorageoverlocalStorage.Identity pools: scope the authenticated IAM role tightly; disable unauthenticated (guest) access unless required.
Validate JWTs against the user pool JWKS (
iss,aud/client_id,token_use,exp) on every protected request. Use a maintained library such asaws-jwt-verifyrather than hand-rolling verification.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/frame-ancestors(clickjacking on login pages), andX-Content-Type-Options: nosniff.Enable logging and monitoring: CloudTrail for Cognito API events (sign-up/sign-in/admin), user pool threat protection (adaptive auth + event logging), CloudWatch alarms on failed/throttled auth, and API Gateway access logging for authorizer decisions.
All Cognito and API endpoints are HTTPS/TLS only; enable encryption at rest with a customer-managed KMS key (and restricted key access) on CloudWatch Log groups, SNS topics used for MFA/notifications, and any identity-pool-fronted upload buckets.
If using SNS for MFA/notification delivery, enable server-side encryption (KMS) on the topic, and keep SMS/email message content limited to what the recipient needs — don't include more PII than the message requires.
References: Amazon Cognito security features (user pools), Amazon Cognito security (top-level, incl. identity pools), and IAM/STS best practices.
Where to Look When This Skill Is Silent
When 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.
API reference (exact params, defaults, errors): Cognito User Pools API and Cognito Identity API
Developer Guide (concepts, workflows): Amazon Cognito Developer Guide
Quotas, rate limits, session-cookie lifetime: Cognito quotas
Feature plans / tier gating: Cognito feature plans
Pricing: Amazon Cognito pricing
CLI reference: aws cognito-idp and aws cognito-identity
Not Covered By This Skill
Amplify Gen2 backend (
defineAuth,amplify/auth.ts,npx ampx sandbox).IAM policy/role/trust-policy authoring, STS, IAM Identity Center console SSO.
API Gateway route/integration setup and Lambda function implementation (this skill covers only the Cognito/JWT authorizer configuration and the purpose of Cognito Lambda triggers).
Files
- ATTRIBUTION.mdAdded by AutoGineer881 B
- LICENSELicence file added by AutoGineer9.9 KiB
- NOTICELicence file added by AutoGineer67 B
- SKILL.md13.5 KiB
- references/api-authorization.md5.0 KiB
- references/identity-pools.md5.8 KiB
- references/lambda-triggers.md9.9 KiB
- references/managed-login-oauth.md15.4 KiB
- references/passkeys.md4.9 KiB
- references/threat-protection.md5.9 KiB
- references/tokens-and-sessions.md11.2 KiB
- references/troubleshooting.md4.6 KiB
- references/user-pools.md8.5 KiB
references/managed-login-oauth.md
Managed Login & OAuth Flows
Overview
Cognito serves two versions of its hosted sign-in pages, chosen per domain via
ManagedLoginVersion: the classic hosted UI (ManagedLoginVersion 1) and managed login
(ManagedLoginVersion 2), which adds a no-code visual branding designer and native support
for passkeys and email/SMS OTP as first-factor sign-in. They are separate domain versions
selected at domain-creation time — not two names for the same thing. Both are hosted, OAuth
2.0–compliant authorization servers with built-in sign-up, sign-in, MFA, password reset, and
social/SAML login. Prefer ManagedLoginVersion 2 for new integrations — managed login
is the successor brand to the classic hosted UI, and passkey / native-OTP factors
require v2. Prefer the hosted pages over a custom login page for faster, more secure
time-to-market; build a custom UI only when branding requirements are strict (and you accept
owning MFA, reset, and federation UX).
Set up the domain
aws cognito-idp create-user-pool-domain \
--user-pool-id <pool-id> \
--domain my-app-login \
--managed-login-version 2 # 2 = managed login (branding designer); 1 = classic hosted UI
# Cognito prefix domain: my-app-login.auth.<region>.amazoncognito.comManaged login v2 needs a branding style per app client
The console auto-assigns a default branding style when you enable managed login v2; the CLI
and API do not. Cognito documents managed login as unavailable for an app client until a
branding style exists, so a domain created with --managed-login-version 2 produces a broken
login page for every client that has no style. After the app client is created, run:
aws cognito-idp create-managed-login-branding \
--user-pool-id <pool-id> \
--client-id <client-id> \
--use-cognito-provided-values--use-cognito-provided-values seeds Cognito's default look; the branding can be customized
later. Run this per app client that uses the domain (each client owns its own style).
Omit this on ManagedLoginVersion 1 (classic hosted UI) — v1 has no branding designer and
does not require this step.
Custom domain (production branding)
For a production custom domain like auth.mycompany.com instead of the default
<prefix>.auth.<region>.amazoncognito.com:
ACM certificate must be in
us-east-1— regardless of your user pool's region. Cognito serves the hosted pages via CloudFront under the hood, and CloudFront distributions require certs in us-east-1. The certificate's primary name (or a SAN) must match the exact custom domain (auth.mycompany.com).Create the user pool domain with the certificate:
aws cognito-idp create-user-pool-domain \ --user-pool-id <pool-id> \ --domain auth.mycompany.com \ --custom-domain-config CertificateArn=arn:aws:acm:us-east-1:<account>:certificate/<uuid> \ --managed-login-version 2Point DNS at Cognito's CloudFront distribution. The response contains the distribution FQDN as
CloudFrontDomain(in the create response) /CloudFrontDistribution(indescribe-user-pool-domain). Set aCNAME— or a Route 53 alias A record — fromauth.mycompany.comto that CloudFront FQDN.
Parent-domain gotcha. Cognito refuses the subdomain if the parent domain
(mycompany.com) has no A record — an SOA record is NOT sufficient. If your apex isn't
behind a real A record (e.g. Route 53 with no landing page), add a dummy A record for
validation and remove it after Cognito accepts the domain.
Timing. Provisioning can take several minutes; describe-user-pool-domain reports
Status: CREATING until CloudFront is ready. Wait for ACTIVE before pointing DNS.
Configure OAuth on the app client
update-user-pool-client replaces the entire client configuration — any field you omit is
reset to its default. It is not a partial update (PATCH); it is a full replace (PUT). Calling
it with only the OAuth parameters against an existing client silently wipes everything else you set
before — ExplicitAuthFlows, AccessTokenValidity/IdTokenValidity, EnableTokenRevocation,
refresh-token rotation, read/write attributes, and more. In an agent context that is a one-shot
outage: the client keeps working just enough that the wipe is invisible until a user hits the
missing flow.
Always read-modify-write. Describe the client first, keep every existing field, add or change only what you were asked to, then re-send the full set.
Most reliable method — round-trip the exact config with --cli-input-json. Rather than
re-typing every flag by hand (easy to drop a field, which then silently resets), take the
describe output, delete the three read-only fields that update rejects
(ClientSecret, CreationDate, LastModifiedDate), apply your change, and feed the whole object
back. Every other field is preserved verbatim:
# 1. Read current config into the exact shape update expects (strip read-only fields).
aws cognito-idp describe-user-pool-client \
--user-pool-id <pool-id> --client-id <client-id> \
--query 'UserPoolClient' --output json \
| jq 'del(.ClientSecret, .CreationDate, .LastModifiedDate)' > client.json
# 2. Apply only the requested change (add callback2 + the `profile` scope), keeping the rest.
jq '.CallbackURLs += ["https://app.example.com/callback2"] | .AllowedOAuthScopes += ["profile"]' \
client.json > client-updated.json
# 3. Re-send the FULL object. Unspecified fields would reset; here nothing is omitted.
aws cognito-idp update-user-pool-client --cli-input-json file://client-updated.jsonIf you instead pass individual --flags, you must repeat every existing field (from the
describe) alongside your change, or the omitted ones reset to default. The --cli-input-json
round-trip above avoids that trap.
The same full-replace rule applies to set-identity-pool-roles (it replaces the whole roles +
RoleMappings structure) — see identity-pools.md.
OAuth flow selection
| Flow | allowed-o-auth-flows | Use for |
|---|---|---|
| Authorization code + PKCE | code | SPAs and mobile (public clients) — default choice |
| Authorization code (with secret) | code | Server-side/confidential clients |
| Client credentials | client_credentials | Machine-to-machine (no user); requires a resource server + custom scopes and a client secret |
Implicit (token) | implicit | Legacy only — returns tokens in the URL fragment; avoid for new apps |
Authorization code + PKCE is the secure default for browser/mobile. The authorize request adds
code_challenge/code_challenge_method=S256; the token exchange sends the matching
code_verifier. No client secret is used.
Machine-to-machine (client credentials) & resource servers
client_credentials is the OAuth flow for service-to-service auth with no user. It needs a
resource server that declares custom scopes, plus a confidential app client (with a
secret) that has the flow enabled and those scopes granted.
Create a resource server with custom scopes. A scope's full identifier is
<resource-server-identifier>/<scope-name>(e.g.https://api.example.com/orders.read):aws cognito-idp create-resource-server \ --user-pool-id <pool-id> \ --identifier https://api.example.com \ --name orders-api \ --scopes ScopeName=orders.read,ScopeDescription="Read orders" \ ScopeName=orders.write,ScopeDescription="Write orders"Create a confidential app client (with a secret), enable the
client_credentialsflow, and grant the custom scopes — noopenid/user scopes, because there is no user:aws cognito-idp create-user-pool-client \ --user-pool-id <pool-id> --client-name svc-client \ --generate-secret \ --allowed-o-auth-flows-user-pool-client \ --allowed-o-auth-flows client_credentials \ --allowed-o-auth-scopes https://api.example.com/orders.readThe service fetches an access token from the token endpoint (HTTP Basic auth with
client_id:client_secret) — no user login, no hosted UI:curl -X POST https://<domain>/oauth2/token \ -H 'Authorization: Basic <base64(client_id:client_secret)>' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -d 'grant_type=client_credentials&scope=https://api.example.com/orders.read'
The response is an access token only — no ID token and no refresh token. Request a new token when it expires.
The access token's
scopeclaim carries the granted scopes; enforce them at your API (require the scope on the route or check thescopeclaim). See api-authorization.md.client_credentialsrequires a user pool domain and a client secret, so it is only for confidential clients — never public browser/mobile clients. Cognito's token endpoint does NOT returninvalid_scope: requesting a scope the client wasn't granted is silently dropped from the responsescopeclaim, or the request fails withinvalid_grant— do not branch oninvalid_scope. The documented error set for/oauth2/tokenisinvalid_request,invalid_client,invalid_grant,unauthorized_client, andunsupported_grant_type. See token endpoint docs.
Authorize → token exchange (code + PKCE)
Redirect the browser to:
https://<domain>/oauth2/authorize?response_type=code&client_id=<id>&redirect_uri=<callback>&scope=openid+email&code_challenge=<challenge>&code_challenge_method=S256&state=<state>Cognito redirects back to
redirect_uri?code=<code>&state=<state>.Exchange the code at
/oauth2/tokenwithgrant_type=authorization_code, thecode, theredirect_uri, and thecode_verifier. Response containsid_token,access_token,refresh_token.
state and nonce (CSRF + replay protection — use both alongside PKCE): generate state as a
cryptographically random, single-use value (e.g. 32 bytes from a CSPRNG), store it bound to the
browser session, and reject the callback if the returned state doesn't match. For OIDC, also
send a random nonce on the authorize request and verify the nonce claim in the returned ID
token. PKCE protects the code exchange; state/nonce protect against CSRF and replay — they are
complementary, not alternatives.
The Amplify client library performs this whole flow for you; see tokens-and-sessions.md.
Social & SAML federation
Never put the IdP client_secret on the command line. Interpolating it into
--provider-details "...client_secret=${G_SECRET}..." exposes it via ps, shell history, and the
agent transcript. Pass --provider-details by file reference instead: write the details to a
umask 077 temp file, pass file://, and delete it. Never echo or log the secret value.
# Example: Google — read the secret from Secrets Manager into a locked-down temp file,
# pass it by file reference (never on the command line), then delete the file.
umask 077
DETAILS=$(mktemp)
G_SECRET=$(aws secretsmanager get-secret-value \
--secret-id google-idp-secret --query SecretString --output text)
cat > "$DETAILS" <<JSON
{"client_id":"<g-id>","client_secret":"${G_SECRET}","authorize_scopes":"openid email profile"}
JSON
unset G_SECRET
aws cognito-idp create-identity-provider \
--user-pool-id <pool-id> \
--provider-name Google --provider-type Google \
--provider-details "file://${DETAILS}" \
--attribute-mapping email=email,name=name
rm -f "$DETAILS"Then add the provider to the app client's --supported-identity-providers (e.g. COGNITO Google).
SAML and OIDC third-party IdPs use --provider-type SAML|OIDC with the metadata URL/document.
Secret handling: store the social IdP client_secret in AWS Secrets Manager, read it at
configuration time, pass it only by file:// reference (as above), and never commit it to source.
Attribute mapping matters: map the IdP's email/name claims to user pool attributes. Without account linking, the same person signing in via different IdPs (or via email + Google) creates separate users. Treat email as non-unique across providers and link deliberately.
Multi-tenant SAML — routing users to their tenant's IdP
A common B2B SaaS pattern: one Cognito user pool, each enterprise tenant brings their own SAML
IdP (Okta, Azure AD, Ping), and each tenant's users must land on their IdP without seeing
the managed-login provider picker. Two /authorize query parameters do this — both silently
redirect through the Authorize endpoint straight to the tenant's IdP:
identity_provider=<ProviderName>— pass the IdP'sProviderName(as configured onCreateIdentityProvider) directly on the authorize URL. Use when the client already knows which tenant the user belongs to.https://<domain>/oauth2/authorize?response_type=code&identity_provider=TenantASAML&client_id=<id>&redirect_uri=<url>idp_identifier=<friendly-id>— pass an IdP identifier configured on the IdP viaIdpIdentifiers(an array of up to 50 friendly names per IdP). Useful when a single IdP owns multiple aliases, or when identifiers match the tenants' email domains and managed login can auto-route by asking the user for their email.aws cognito-idp create-identity-provider \ --user-pool-id <pool-id> \ --provider-name TenantASAML --provider-type SAML \ --idp-identifiers tenant-a.example.com corp.tenant-a.io \ --provider-details MetadataURL=https://tenant-a.example.com/saml/metadata.xml \ --attribute-mapping email=... # then on /authorize: # idp_identifier=tenant-a.example.com
Add the IdP to the app client's --supported-identity-providers (each tenant IdP still needs
to be a supported provider on the client). Since the routing parameters bypass the picker, users
never see other tenants' IdPs — the tenant list stays private per tenant.
Callback URL rules
Registered callback and logout URLs must match exactly — scheme, host, path, and trailing
slash all count. HTTP (not HTTPS) is allowed only for loopback addresses — http://localhost,
http://127.0.0.1, and http://[::1] — for local dev; every other web URL must be HTTPS.
Custom application schemes (e.g. myapp://callback) are also allowed — that's how native
mobile apps receive the redirect, which matters because this skill steers mobile apps to the
authorization-code + PKCE flow. A mismatch produces redirect_mismatch.
Common Errors
| Error | Cause | Fix |
|---|---|---|
redirect_mismatch | Callback URL not registered exactly | Add the exact URL to Allowed callback URLs |
invalid_grant on token exchange | Reused/expired code, or missing code_verifier | Exchange the code once, promptly, with the matching verifier |
| Social login loops or drops attributes | Missing attribute mapping / provider not on client | Map attributes; add the IdP to the app client |
Related
tokens-and-sessions.md for handling the returned tokens.
troubleshooting.md for redirect/CORS/federation issues.
Authoritative sources
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an MCP server, Needs Node.js
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- AWS
- Publisher
- AWS (Official)
- Source
- aws/agent-toolkit-for-aws · skills/core-skills/aws-auth · commit 0a218f8
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- NOTICE (added by AutoGineer from NOTICE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
- Also distributed in
- aws/agent-toolkit-for-aws
AutoGineer is not affiliated with or endorsed by AWS.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download aws-auth.zip