Directory

← Back

PasswordStrengthVaadin

Password Strength on Vaadin 14+, embeded checker on strength of password

Author

Contributors

Rating

An integration of Vaadin 14, LitElemnet, zxcvbn and polymer-password-strength. Compiled by Java 11.

  • zxcvbn is embeded within this addon. zxcvbn is a password strength estimator inspired by password crackers.
  • zxcvbn4j is a java port of zxcvbn.

Your donation makes the addon much better, thanks for all your support.

Sample code

//Common Usage
VaadinPasswordStrength passwordStrength = new VaadinPasswordStrength();
passwordField.addValueChangeListener(event-> {
            StrengthFeedback strengthFeedback = passwordStrength.getStrengthFeedback(event.getValue()); //Embeded algorithm to measure real password strength. You could implement your own algorithm, and set the score to VaadinPasswordStrength.
            double guess10 = strengthFeedback.getStrength().getGuessesLog10();
            int score = strengthFeedback.getStrength().getScore();
            if(score==0) {
                 if(guess10!=0) {
                     score = 1;
                 }
            }else{
                  score += 1;
            }
            passwordStrength.setScore(score);//The key of the addon to show the indicator of password strength. Value of score is between 0 and 5.
        });

//Get Score
strengthFeedback.getStrength().getScore();

//Get Warning
strengthFeedback.getLocalizedWarning();

//Get Suggestion
strengthFeedback.getLocalizedSuggestions();

Links

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

  • Add npm dependency
  • Upgrade Vaadin to v14.5.2
Released
2021-04-13
Maturity
TESTED
License
Apache License 2.0

Compatibility

Framework
Vaadin 14+
Browser
Firefox
Opera
Safari
Google Chrome
iOS Browser
Android Browser
Microsoft Edge
Online