I am using aws cognito for authentication. I have two environment for development and production hosted in two different region.
Development in us-east-1
Production in us-west-2
I want to change cognito hosted UI authentication (federatedSignIn) to custom aws-amplify signIn. Development configuration works fine while signIn in both hosted UI authentication and custom signIn aws-amplify. In production environment hosted UI works fine while signIn but custom signIn returns
{"__type":"NotAuthorizedException","message":"Incorrect username or password."}
for already existing users.
The only different configuration in development and production environment is
Development -> Always
Production -> No
Does this configuration effects custom signIn ?
aws-amplify configure
Amplify.configure({
aws_project_region: *******************,
aws_cognito_region: *******************,
aws_user_pools_id: *******************,
aws_user_pools_web_client_id: *******************,
authenticationFlowType: 'USER_SRP_AUTH'
oauth: {
domain: *******************,
scope: ['email', 'openid', 'profile'],
redirectSignIn: `*******************`,
redirectSignOut: `*******************`,
responseType: 'code',
},
});
I am able to replicate the issue. The issue was wrong POOL_ID. Wrong POOL_ID doesn't effect hosted UI signIn but does effect effect amplify login, that's why its return 'Incorrect username and password' for correct email and password.