Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cognito: UserNotConfirmedException before NotAuthorized #4608

Open
cbaser opened this issue Mar 10, 2024 · 2 comments
Open

Cognito: UserNotConfirmedException before NotAuthorized #4608

cbaser opened this issue Mar 10, 2024 · 2 comments
Assignees
Labels
bug This issue is a bug. p3 This is a minor priority issue service-api This issue is due to a problem in a service API, not the SDK implementation.

Comments

@cbaser
Copy link

cbaser commented Mar 10, 2024

Describe the bug

Hello,

My example scenario is the following:

If i register a new user with email : test@test.com , password : Test@123 and did not verify the mail, then if i login with same email but different password such as Example@123 then it gives an UserNotConfirmedException error which is for User is not confirmed.

Instead of that I need : wrong email / password combination - NotAuthorizedException. As password entered is incorrect.

Do you have any suggestions to fix this?

Thank you!

Expected Behavior

Cognito throws NotAuthorizedException

Current Behavior

Cognito throws UserNotConfirmedException

Reproduction Steps

try{
        const params = {
                    AuthFlow: 'USER_PASSWORD_AUTH',
                    ClientId: 'client_id',
                    AuthParameters: {
                        'USERNAME': username,
                        'PASSWORD': password
                    }
                };
                const data = await cognito.initiateAuth(params).promise();

// other code
  

}catch(err){
console.log(err)
}

Possible Solution

No response

Additional Information/Context

No response

SDK version used

2.1568.0

Environment details (OS name and version, etc.)

Node.js in Lambda

@cbaser cbaser added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 10, 2024
@aBurmeseDev
Copy link
Member

Hi @cbaser - thanks for reaching out.

According to the service API docs, NotAuthorizedException gets thrown when a user isn't authorized and UserNotConfirmedException when a user isn't confirmed successfully. Since those are coming from the service API rather than SDK, I'm going to have to reach out to service team to get some guidance on your use case. I'll post update once I hear back. (ref: P124067600)

@aBurmeseDev aBurmeseDev added service-api This issue is due to a problem in a service API, not the SDK implementation. p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Mar 28, 2024
@aBurmeseDev aBurmeseDev self-assigned this Mar 28, 2024
@cbaser
Copy link
Author

cbaser commented May 3, 2024

@aBurmeseDev do you have any updates on this? We are still getting UserNotConfirmedException before NotAuthorizedException

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p3 This is a minor priority issue service-api This issue is due to a problem in a service API, not the SDK implementation.
Projects
None yet
Development

No branches or pull requests

2 participants