Category / Section
How to implement strong password policy in Gluu's default password reset feature
Published:
1 min read
Here we are showing how we can implement a password policy so when user will reset their password, it will only take strong password.
Strong password means:
- It contains at least 8 characters and at most 20 characters
- It contains at least one digit
- It contains at least one upper case alphabet
- It contains at least one lower case alphabet
- It contains at least one special character which includes !@#$%&*()-+=^.
- It doesn’t contain any white space
Modification in attribute
We just need to apply a regular expression to impose strong password in userPassword
attribute.
Regular expression will be:
- Regex Pattern:
^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#&()--[{}]:;',?/*~$^+=<>]).{8,20}$
Above regular expression can be modified easily to support differnt strong password policy according to own organisation.