AdminInitiateAuth doesn't return "reset required" for imported users

0

Hi there,

We are migrating our user base to AWS Cognito. we successfully imported all users to a userpool, and the imported users state is set to "RESET_REQUIRED" which is the expected behaviour. Now the problem is when we try to log in using a username and a password for any of the imported users using the "AdminInitiateAuth" API, the API returns "Incorrect username or password" instead of "Password reset is required". However, when we set the status of a user that is not imported to "RESET_REQUIRED", the API returns "Password reset is required" as expected.

My question is how to configure Cognito to return "Password reset is required" for imported users? we will use the API response to redirect the user to the appropriate flow, depending on the error type.

Thanks in advance,
Khaled

질문됨 3년 전425회 조회
1개 답변
0

Finally got it working!

After reading the documentation in depth, I was able to find this page: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-using-import-tool-password-reset.html

We just need to set the "Prevent User Existence Errors to legacy in the client settings.

답변함 3년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠