Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

536
Views
AWS Coginto API , Forgot Password Action not raising InvalidParameterException even if neither a verified phone number nor a verified email exists

As per docs says https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_ForgotPassword.html If the user has not yet verified his email or phone number then

Auth.forgotPassword(username)

should return some error message. as written in documentation

If neither a verified phone number nor a verified email exists, an InvalidParameterException is thrown.

but it's not raising an exception, instead, I receive a success response.

"CodeDeliveryDetails":{"AttributeName":"email","DeliveryMedium":"EMAIL","Destination":"m***@g***.com"}}

I dont receive the email though.

what can be the reason ?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

I was seeing the same problem. It turned out related to this:

Use the PreventUserExistenceErrors setting of a user pool application client to enable or disable errors related to user existence.

Mentioned here: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-managing-errors.html :

After changing that setting in the user group to 'Legacy' from 'Enabled', I started seeing a 400 response:

 { "__type": "UserNotFoundException", "message": "Username/client id combination not found." }
over 4 years ago · Santiago Trujillo Report

0

@ryan-hines oh my god thank you! I have been struggling with this for days.

We had a very similar problem:

  • The user registers through Google
  • User tries to reset password
  • We wanted to disallow this and tell them to use their social login (you'd think Cognito would take care of this part, but no)
    • To solve this, we write a custom migration lambda to handle "UserMigration_ForgotPassword"
    • Even though we threw an error in the lambda, it still showed a success message in the UI, but didn't send the email.

In the new Cognito UI, we had to enter:

  • Application Integration
  • Click on the application client
  • Click "Edit" in the customer information section of the app
  • At the bottom, under "Advanced security settings", uncheck "Prevent user existence errors"

The UI now correctly displays a failure when our lambda throws an error.

checkbox to prevent user existence errors

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!