In previous post under Passay, I showed one example of how to use “IllegalSequenceRule” with custom character sequences. This post is continuation of the previous post with another example. In the previous post, I used different two custom character sequences, one character sequence containing only numbers and another character sequence containing only alphabets. In this…… Continue reading IllegalSequenceRule with custom character sequences example 2
Category: Passay
IllegalSequenceRule with custom character sequences example 1
In previous post under Passay, I showed with example the purpose of “IllegalSequenceRule”. For recap, this rule makes sure that the password doesn’t contain the given character sequence, for example “qwerty” character sequence. So if the password is “qwerty” or “sam_qwerty_@”, the validation will fail but if the password is “aabb”, the validation passes. When…… Continue reading IllegalSequenceRule with custom character sequences example 1
CharacterCharacteristicsRule example
In this post under Passay, I will explain with example, the purpose and how to use “CharacterCharacteristicsRule”. “CharacterCharacteristicsRule” acts as a container of other rules and we can configure it to say that out of n rules, make sure atleast first m rules are satisfied, where m < n. Below is the complete main class…… Continue reading CharacterCharacteristicsRule example
IllegalSequenceRule example
In this post under Passay, I will explain with example the purpose of “IllegalSequenceRule” class. This class is used to verify that the user given password doesn’t contain known illegal sequence of characters like “qwerty” etc. Below is the complete code showing how to use it Main class package defaultPackage; import org.passay.EnglishSequenceData; import org.passay.IllegalSequenceRule; import…… Continue reading IllegalSequenceRule example
Generating random password using only user defined characters
In this post under Passay, I will show with example how to generate random password using user defined characters. To generate a random password, we need to come up with a list of “CharacterRule” instances. Each “CharacterRule” class take two data as constructor arguments as listed below1) instance of “CharacterData” interface2) min number of characters…… Continue reading Generating random password using only user defined characters
Checking whether the password is already present in another source
In this post under Passay, I will show how to check whether the password is already used in another source. Below is the complete main class for your reference. Main class 1 package defaultPackage; 2 3 import java.util.ArrayList; 4 import java.util.List; 5 6 import org.passay.PasswordData; 7 import org.passay.PasswordData.SourceReference; 8 import org.passay.PasswordValidator; 9 import org.passay.RuleResult; 10…… Continue reading Checking whether the password is already present in another source
Checking whether the password is already used in your application
In this post under Passay, I will show with example how to check whether a user entered password is already used in the application or not. Below is the complete main code for your reference Main class 1 package defaultPackage; 2 3 import java.util.ArrayList; 4 import java.util.List; 5 6 import org.passay.HistoryRule; 7 import org.passay.PasswordData; 8…… Continue reading Checking whether the password is already used in your application
IllegalRegexRule example
In this post under Passay, I will explain with example the purpose of “IllegalRegexRule” class. In one of my previous post, I have explained with example the purpose of “AllowedRegexRule” class. We will have recap of it here. When validating password, we mainly check whether the password follows a particular pattern. If the password follows…… Continue reading IllegalRegexRule example
AllowedRegexRule example
In this post under Passay, I will explain with example the purpose of “AllowedRegexRule” class. When validating password, we mainly check whether the password follows a particular pattern. If the password follows the pattern it is valid or else invalid. We use regular expressions, to create that pattern. “AllowedRegexRule” class will do the job of…… Continue reading AllowedRegexRule example
LengthComplexityRule example
In this port under Passay, I will show with example the purpose of “LengthComplexityRule” class. In all my previous posts under Passay, I showed how a password will have one set of rules that should be evaluated to check whether the password is valid or not. Whereas in real situation, the rules to be evaluated…… Continue reading LengthComplexityRule example