-
Notifications
You must be signed in to change notification settings - Fork 944
Add support for validating passwords against the password policy in auth #7514
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
Conversation
* Add password policy endpoint in auth to allow fetching the password policy for the project/tenant
* Add PasswordPolicy and PasswordValidationStatus public types * Add public types to docs and implement AuthInternal password policy cache * Add schema version mismatch error and tests * Update error code in fetch test and add TODO for schema version handling
* Add password does not meet requirements error and update policy in sign up flow when error is received
* Add validatePassword method with implementation TODO
* Define internal password policy typings
* Define PasswordPolicyImpl * Add PasswordPolicyCustomStrengthOptions internal typing
* Update Auth to use PasswordPolicyImpl for validation * Rename _getPasswordPolicy to _getPasswordPolicyInternal
…tch API proposal (#7456) * Implement validatePassword * Fix allowedNonAlphanumericCharacters typing to match API proposal
… does not meet the backend requirements (#7434) * Update confirmPasswordReset to handle updating the cache upon password requirements error * Refactor existing test cases to clean up code style
…ot meet the backend requirements (#7435) * Update signInWithEmailAndPassword to handle updating password policy cache * Remove await on calls recachePasswordPolicy * Throw errors instead of rejecting promises
…putted to validatePassword (#7471) * Include the character option statuses even when an empty string is inputted
* Update auth demo to include a section for password validation
…7476) * Add enforcementState and forceUpgradeOnSignin to PasswordPolicy type
…icy response (#7485) * Store an empty string if no non-alphanumeric characters are included in the password policy response
…a password (#7487) * Update auth demo with new fields and move validation into auth flow sections
* Use a default minimum password length of 6 when it is undefined in the password policy response as a temporary solution until the backend is updated
* Add password policy integration tests and helper method for generating valid passwords * Update prodbackend tests to include password policy tests * Update README with password policy integration testing instructions
* Update handling of password policy recaching in sign up to not conflict with handling of other errors like missing reCAPTCHA token
🦋 Changeset detectedLatest commit: fbd258c The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1This report is too large (381,042 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.Test Logs |
@DellaBitta Can you help review this? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Half way through, but I will continue in the morning. Some comments so far.
Add a
validatePassword
method that allows developers to validate passwords against the password policy configured for the project or tenant. This method returns a status object,PasswordValidationStatus
, that can be used to display the requirements and check whether each was met.