Local emulator for Amazon Cognito
A Good Enough offline emulator for Amazon Cognito.
| Feature | Support |
|---|---|
| AddCustomAttributes | ✅ |
| AdminAddUserToGroup | ✅ |
| AdminConfirmSignUp | ✅ |
| AdminCreateUser | (partial support) |
| AdminDeleteUser | ✅ |
| AdminDeleteUserAttributes | ✅ |
| AdminDisableProviderForUser | ❌ |
| AdminDisableUser | ✅ |
| AdminEnableUser | ✅ |
| AdminForgetDevice | ❌ |
| AdminGetDevice | ❌ |
| AdminGetUser | ✅ |
| AdminInitiateAuth | (partial support) |
| AdminLinkProviderForUser | ❌ |
| AdminListDevices | ❌ |
| AdminListGroupsForUser | ✅ |
| AdminListUserAuthEvents | ❌ |
| AdminRemoveUserFromGroup | ✅ |
| AdminResetUserPassword | ❌ |
| AdminRespondToAuthChallenge | ❌ |
| AdminSetUserMFAPreference | ❌ |
| AdminSetUserPassword | ✅ |
| AdminSetUserSettings | ❌ |
| AdminUpdateAuthEventFeedback | ❌ |
| AdminUpdateDeviceStatus | ❌ |
| AdminUpdateUserAttributes | ✅ |
| AdminUserGlobalSignOut | ❌ |
| AssociateSoftwareToken | (partial support) |
| ChangePassword | ✅ |
| ConfirmDevice | ❌ |
| ConfirmForgotPassword | (partial support) |
| ConfirmSignUp | (partial support) |
| CreateGroup | ✅ |
| CreateIdentityProvider | ❌ |
| CreateResourceServer | ❌ |
| CreateUserImportJob | ❌ |
| CreateUserPool | ✅ |
| CreateUserPoolClient | ✅ |
| CreateUserPoolDomain | ❌ |
| DeleteGroup | ✅ |
| DeleteIdentityProvider | ❌ |
| DeleteResourceServer | ❌ |
| DeleteUser | ✅² |
| DeleteUserAttributes | ✅ |
| DeleteUserPool | ✅² |
| DeleteUserPoolClient | ✅² |
| DeleteUserPoolDomain | ❌ |
| DescribeIdentityProvider | ❌ |
| DescribeResourceServer | ❌ |
| DescribeRiskConfiguration | ❌ |
| DescribeUserImportJob | ❌ |
| DescribeUserPool | ✅ |
| DescribeUserPoolClient | ✅ |
| DescribeUserPoolDomain | ❌ |
| ForgetDevice | ❌ |
| ForgotPassword | (partial support) |
| GetCSVHeader | ❌ |
| GetDevice | ❌ |
| GetGroup | ✅² |
| GetIdentityProviderByIdentifier | ❌ |
| GetSigningCertificate | ❌ |
| GetUICustomization | ❌ |
| GetUser | ✅ |
| GetUserAttributeVerificationCode | ✅ |
| GetUserPoolMfaConfig | ✅ |
| GlobalSignOut | ❌ |
| InitiateAuth | (partial support) |
| ListDevices | ❌ |
| ListGroups | ✅¹ |
| ListIdentityProviders | ❌ |
| ListResourceServers | ❌ |
| ListTagsForResource | ❌ |
| ListUserImportJobs | ❌ |
| ListUserPoolClients | ✅¹ |
| ListUserPools | ✅¹ |
| ListUsers | ✅¹ |
| ListUsersInGroup | ✅¹ |
| ResendConfirmationCode | ❌ |
| RespondToAuthChallenge | (partial support) |
| RevokeToken | (partial support) |
| SetRiskConfiguration | ❌ |
| SetUICustomization | ❌ |
| SetUserMFAPreference | ✅ |
| SetUserPoolMfaConfig | ✅ |
| SetUserSettings | ❌ |
| SignUp | (partial support) |
| StartUserImportJob | ❌ |
| StopUserImportJob | ❌ |
| TagResource | ❌ |
| UntagResource | ❌ |
| UpdateAuthEventFeedback | ❌ |
| UpdateDeviceStatus | ❌ |
| UpdateGroup | ✅ |
| UpdateIdentityProvider | ❌ |
| UpdateResourceServer | ❌ |
| UpdateUserAttributes | ✅ |
| UpdateUserPool | ✅ |
| UpdateUserPoolClient | ✅² |
| UpdateUserPoolDomain | ❌ |
| VerifySoftwareToken | (partial support) |
| VerifyUserAttribute | ✅ |
¹ does not support pagination or attribute filters, all results and attributes will be returned in the first request.
² "requires developer credentials" is not enforced
Additional supported features:
cognito-local can emulate Cognito's Lambda Triggers
by either invoking a real Lambda in an AWS account or a Lambda running on your local machine (via any tool which
supports the LambdaInvoke functionality, for example
serverless-offline).
To configure a Lambda Trigger, modify your configuration file to include a TriggerFunctions object
with a key for the Trigger and the value as your Lambda function name.
{
"TriggerFunctions": {
"CustomMessage": "my-function-name"
}
}If you're using local invoke, you will also need to modify the LambdaClient.endpoint configuration to tell
cognito-local how to connect to your local Lambda server:
{
"LambdaClient": {
"endpoint": "http://host:port"
},
"TriggerFunctions": {
"CustomMessage": "my-local-function-name"
}
}If you're running cognito-local in Docker and your local Lambda functions on your host, you may need to use the Docker local networking hostname as your endpoint. For example, on my Mac I use
http://host.docker.internal:3002.
| Trigger | Operation | Support |
|---|---|---|
| CreateAuthChallenge | * | ❌ |
| CustomEmailSender | CustomEmailSender_SignUp | ✅ |
| CustomEmailSender | CustomEmailSender_ResendCode | ✅ |
| CustomEmailSender | CustomEmailSender_ForgotPassword | ✅ |
| CustomEmailSender | CustomEmailSender_UpdateUserAttribute | ✅ |
| CustomEmailSender | CustomEmailSender_VerifyUserAttribute | ✅ |
| CustomEmailSender | CustomEmailSender_AdminCreateUser | ✅ |
| CustomEmailSender | CustomEmailSender_AccountTakeOverNotification | ❌ |
| CustomMessage | AdminCreateUser | ✅ |
| CustomMessage | Authentication | ✅ |
| CustomMessage | ForgotPassword | ✅ |
| CustomMessage | ResendCode | ❌ |
| CustomMessage | SignUp | ✅ |
| CustomMessage | UpdateUserAttribute | ✅ |
| CustomMessage | VerifyUserAttribute | ✅ |
| DefineAuthChallenge | * | ❌ |
| PostAuthentication | PostAuthentication_Authentication | ✅ |
| PostConfirmation | ConfirmForgotPassword | ✅ |
| PostConfirmation | ConfirmSignUp | ✅ |
| PreAuthentication | * | ❌ |
| PreSignUp | PreSignUp_AdminCreateUser | ❌ |
| PreSignUp | PreSignUp_ExternalProvider | ❌ |
| PreSignUp | PreSignUp_SignUp | ✅ |
| PreTokenGeneration | TokenGeneration_AuthenticateDevice | ❌ |
| PreTokenGeneration | TokenGeneration_Authentication | ✅ |
| PreTokenGeneration | TokenGeneration_HostedAuth | ❌ |
| PreTokenGeneration | TokenGeneration_NewPasswordChallenge | ❌ |
| PreTokenGeneration | TokenGeneration_RefreshTokens | ✅ |
| UserMigration | Authentication | ✅ |
| UserMigration | ForgotPassword | ❌ |
| VerifyAuthChallengeResponse | * | ❌ |
docker run --publish 9229:9229 jagregory/cognito-local:latestCognito Local will now be listening on http://localhost:9229.
To persist your database between runs, mount the /app/.cognito volume to your host machine:
docker run --publish 9229:9229 --volume $(pwd)/.cognito:/app/.cognito jagregory/cognito-local:latestNo open issues yet, or sync has not completed.