Skip to content

A custom password validator implementation for WSO2 Identity Server using WSO2 Custom Password Validator extension

Notifications You must be signed in to change notification settings

athiththan11/Countersign-Validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Countersign Validator

A custom password validator (custom password policy extension) implementation to validate password against a set of commonly used dictionary values and username.

Simple put, the custom password validator (countersign validator) throws an error if the password is same as the useranem, and if the password contains any of the following strings ...

  • admin
  • password
  • root
  • 123

Build

Build the project by running ...

mvn clean package

Deploy

After a successful build, copy the countersign-validator-1.0.0.jar artifact from the target folder and paste it inside <IS HOME>/repository/components/dropins folder. And specify the deployed password validator as an extension inside the <IS HOME>/repository/conf/identity/identity-mgt.properties file.

Simply add the following lines at the end of the identity-mgt.properties file to use the custom password validator implementation

Password.policy.extensions.1=com.athiththan.sample.CountersignValidator
Password.policy.extensions.1.faultMsg="Validation failed :: according to Countersign Validator"

Navigate to <IS HOME>/repository/conf/identity/identity.xml and enable the following EventListener to enable=true

<EventListener type="org.wso2.carbon.user.core.listener.UserOperationEventListener"
                       name="org.wso2.carbon.identity.mgt.IdentityMgtEventListener"
                       orderId="50" enable="true"/>

Run

Start your WSO2 Identity Server by executing the command from your <IS HOME>/bin folder

sh wso2server.sh

or

wso2is-5.5.0

Test & Results

Navigate to the Carbon Management console and login as admin using admin for both the username and password.

Navigate to Main -> Identity -> Users and Roles -> Add -> Add New User

Add User Screen WSO2 Identity Server

and provide

  1. your favourite string as both username and password
  2. enter any username and enter a password containing any above mentioned strings

click finish and see the prompted error messages.

About

A custom password validator implementation for WSO2 Identity Server using WSO2 Custom Password Validator extension

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages