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

[Help Wanted] How to validate password in Javascript code before sending it to AWS Amplify #709

Closed
vahdet opened this issue Apr 23, 2018 · 2 comments
Labels
question General question

Comments

@vahdet
Copy link

vahdet commented Apr 23, 2018

I want my web front-end to validate the password before calling an Auth.signup(...) method, so that I can verify that the password that the user types is satisfying the AWS Cognito User Pool's policy.

Is there a way for generating a password-checker derived from AWS Cognito User Pool Policy (i.e. require number, require special chaarcter etc.) for Javascript?

@manueliglesias manueliglesias added the question General question label Apr 24, 2018
@manueliglesias
Copy link
Contributor

Hi @vahdet

Currently there is no way, that I know of, to do what you want. It is a very interesting use case that I'll make sure to share with the team!

This would require knowing in your front-end the current password policy, and verify according to it.

If this is a problem you would like to tackle yourself, you could start by looking at the Amazon Cognito API reference, specifically the DescribeUserPool operation. It gives you access to the Password policy for your user pool. maybe you could call this operation at build time, save the policy as a json that you can include in your front-end code and verify at runtime.

{
      // ...
      "Policies": { 
         "PasswordPolicy": { 
            "MinimumLength": number,
            "RequireLowercase": boolean,
            "RequireNumbers": boolean,
            "RequireSymbols": boolean,
            "RequireUppercase": boolean
         }
      },
      // ...
}

@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question General question
Projects
None yet
Development

No branches or pull requests

2 participants