jagregory / cognito-local

Local emulator for Amazon Cognito
MIT License
289 stars 74 forks source link

Update user attributes response not the same as the aws service #380

Open ignatescustefan opened 1 year ago

ignatescustefan commented 1 year ago

When calling user attributes for the cognito aws service for a user that can not be found, the call returns a UserNotFoundException:

aws cognito-idp admin-update-user-attributes --user-pool-id user-pool-id --username user-notfound@gmail --user-attributes Name="custom:authChallenge",Value="test"

An error occurred (UserNotFoundException) when calling the AdminUpdateUserAttributes operation: User does not exist.

But when I am doing the same call to docker container mock, the call returns a NotAuthorizedException:

aws --endpoint http://localhost:9229 cognito-idp admin-update-user-attributes --user-pool-id local_0tj8Jz4s --username user-notfound@gmail --user-attributes Name="custom:authChallenge",Value="test"

An error occurred (NotAuthorizedException) when calling the AdminUpdateUserAttributes operation: User not authorized
MyGuyCai commented 9 months ago

I'm getting the same with aws sdk 3, using the InitiateAuthCommand with an invalid username or password returns InvalidPasswordException with cognito-local but returns NotAuthorizedException with aws cognito