Last active
July 6, 2019 05:20
Handling published events using HandleEvent() method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void handleEvent(Event event) throws IdentityEventException { | |
if (log.isDebugEnabled()) { | |
log.debug("handleEvent() invoked"); | |
} | |
if (IdentityEventConstants.Event.PRE_UPDATE_CREDENTIAL.equals(event.getEventName()) | |
|| IdentityEventConstants.Event.PRE_UPDATE_CREDENTIAL_BY_ADMIN.equals(event.getEventName())) { | |
Object credential = event.getEventProperties().get(IdentityEventConstants.EventProperty.CREDENTIAL); | |
if (!DefaultDefectivePasswordValidator.getInstance().validate(credential)) { | |
if (log.isDebugEnabled()) { | |
log.debug("given password is defective"); | |
} | |
throw Utils.handleEventException( | |
DefectivePasswordValidatorConstants.ErrorMessages.ERROR_CODE_CRACKED_PASSWORD_VALIDATION, null); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment