Cognito
Protocol: JSON 1.1 (X-Amz-Target: AWSCognitoIdentityProviderService.*)
Endpoint: POST http://localhost:4566/
Floci serves pool-specific discovery and JWKS endpoints, plus a relaxed OAuth token endpoint, so local clients can mint and validate Cognito-like access tokens against RS256 signing keys.
CreateUserPool supports overiding several values using user-pool tags only at creation time:
floci:override-id, to pin the resulting UserPool.Id.
floci:override-cognito-client-id
- set to
use-name to use the client name as client ID.
- set to
append-to-name:-somestring to append a string to the client name to be used as client ID.
- set to
prepend-to-name:somestring- to prepend a string to the client name to be used as client ID.
floci:override-cognito-client-secret, to set the secret for all clients created in this userpool.
Floci strips reserved floci:* tags from stored and returned UserPoolTags on both create and update paths, so the tag namespace acts as an input-only control channel and is never persisted as user-visible metadata.
Standalone TagResource rejects reserved floci:* keys. ListTagsForResource and UntagResource operate on the persisted user-pool tag map.
Supported Actions
User Pools
| Action |
Description |
| CreateUserPool |
- |
| DescribeUserPool |
- |
| ListUserPools |
- |
| UpdateUserPool |
- |
| DeleteUserPool |
- |
User Pool Tags
| Action |
Description |
| TagResource |
- |
| UntagResource |
- |
| ListTagsForResource |
- |
User Pool Clients
| Action |
Description |
| CreateUserPoolClient |
- |
| DescribeUserPoolClient |
- |
| ListUserPoolClients |
- |
| DeleteUserPoolClient |
- |
Resource Servers
| Action |
Description |
| CreateResourceServer |
- |
| DescribeResourceServer |
- |
| ListResourceServers |
- |
| DeleteResourceServer |
- |
Admin User Management
| Action |
Description |
| AdminCreateUser |
- |
| AdminGetUser |
- |
| AdminDeleteUser |
- |
| AdminSetUserPassword |
- |
| AdminUpdateUserAttributes |
- |
User Operations
| Action |
Description |
| SignUp |
- |
| ConfirmSignUp |
- |
| GetUser |
- |
| UpdateUserAttributes |
- |
| ChangePassword |
- |
| ForgotPassword |
- |
| ConfirmForgotPassword |
- |
Authentication
| Action |
Description |
| InitiateAuth |
- |
| AdminInitiateAuth |
- |
| RespondToAuthChallenge |
- |
User Listing
| Action |
Description |
| ListUsers |
- |
Groups
| Action |
Description |
| CreateGroup |
- |
| GetGroup |
- |
| UpdateGroup |
- |
| ListGroups |
- |
| ListUsersInGroup |
- |
| DeleteGroup |
- |
| AdminAddUserToGroup |
- |
| AdminRemoveUserFromGroup |
- |
| AdminListGroupsForUser |
- |
Well-Known And OAuth Endpoints
| Endpoint |
Description |
GET /{userPoolId}/.well-known/openid-configuration |
OpenID discovery document |
GET /{userPoolId}/.well-known/jwks.json |
JSON Web Key Set for JWT validation |
POST /cognito-idp/oauth2/token |
Relaxed OAuth token endpoint for grant_type=client_credentials |
POST /cognito-idp/oauth2/token is intentionally emulator-friendly rather than full Cognito parity:
- It requires an existing
client_id.
- It accepts
client_id and client_secret from the form body or Basic auth.
- It requires a confidential app client created with
GenerateSecret=true.
- It requires
AllowedOAuthFlowsUserPoolClient=true and AllowedOAuthFlows=["client_credentials"].
- It doesn't require a Cognito domain.
- It returns only
access_token, token_type, and expires_in.
- It validates requested OAuth scopes against the app client's
AllowedOAuthScopes and the pool's registered resource-server scopes.
- It advertises the prefixed token endpoint in
/{userPoolId}/.well-known/openid-configuration.
Configuration
| Variable |
Default |
Description |
FLOCI_SERVICES_COGNITO_ENABLED |
true |
Enable or disable the service |
Examples
JWT Validation
Tokens issued by Floci can be validated using the discovery and JWKS endpoints:
Tokens include the cognito:groups claim as a JSON array when the authenticated user belongs to one or more groups.
Tokens issued by Cognito auth flows and the OAuth token endpoint use the emulator base URL plus the pool id:
This keeps the issuer, discovery document, JWKS URL, and token endpoint internally consistent for local JWT validation while supporting LocalStack-style confidential clients and resource-server-backed scopes.