use of org.wso2.carbon.identity.recovery.handler.ChallengeAnswerValidationHandler in project identity-governance by wso2-extensions.
the class IdentityRecoveryServiceComponent method activate.
@Activate
protected void activate(ComponentContext context) {
try {
BundleContext bundleContext = context.getBundleContext();
bundleContext.registerService(NotificationPasswordRecoveryManager.class.getName(), NotificationPasswordRecoveryManager.getInstance(), null);
bundleContext.registerService(SecurityQuestionPasswordRecoveryManager.class.getName(), SecurityQuestionPasswordRecoveryManager.getInstance(), null);
bundleContext.registerService(NotificationUsernameRecoveryManager.class.getName(), NotificationUsernameRecoveryManager.getInstance(), null);
bundleContext.registerService(UserSelfRegistrationManager.class.getName(), UserSelfRegistrationManager.getInstance(), null);
bundleContext.registerService(ChallengeQuestionManager.class.getName(), ChallengeQuestionManager.getInstance(), null);
bundleContext.registerService(ResendConfirmationManager.class.getName(), ResendConfirmationManager.getInstance(), null);
bundleContext.registerService(AbstractEventHandler.class.getName(), new AccountConfirmationValidationHandler(), null);
bundleContext.registerService(AbstractEventHandler.class.getName(), new UserSelfRegistrationHandler(), null);
bundleContext.registerService(AbstractEventHandler.class.getName(), new LiteUserRegistrationHandler(), null);
bundleContext.registerService(AbstractEventHandler.class.getName(), new UserEmailVerificationHandler(), null);
bundleContext.registerService(AbstractEventHandler.class.getName(), new MobileNumberVerificationHandler(), null);
bundleContext.registerService(AbstractEventHandler.class.getName(), new AdminForcedPasswordResetHandler(), null);
bundleContext.registerService(AbstractEventHandler.class.getName(), new TenantRegistrationVerificationHandler(), null);
bundleContext.registerService(AbstractEventHandler.class.getName(), new IdentityUserMetadataMgtHandler(), null);
bundleContext.registerService(IdentityConnectorConfig.class.getName(), new RecoveryConfigImpl(), null);
bundleContext.registerService(IdentityConnectorConfig.class.getName(), new SelfRegistrationConfigImpl(), null);
bundleContext.registerService(IdentityConnectorConfig.class.getName(), new LiteRegistrationConfigImpl(), null);
bundleContext.registerService(IdentityConnectorConfig.class.getName(), new UserEmailVerificationConfigImpl(), null);
bundleContext.registerService(IdentityConnectorConfig.class.getName(), new UserClaimUpdateConfigImpl(), null);
bundleContext.registerService(IdentityConnectorConfig.class.getName(), new AdminForcedPasswordResetConfigImpl(), null);
bundleContext.registerService(AbstractEventHandler.class.getName(), new CodeInvalidationHandler(), null);
UsernameRecoveryManager usernameRecoveryManager = new UsernameRecoveryManagerImpl();
bundleContext.registerService(UsernameRecoveryManager.class.getName(), usernameRecoveryManager, null);
PasswordRecoveryManager passwordRecoveryManager = new PasswordRecoveryManagerImpl();
bundleContext.registerService(PasswordRecoveryManager.class.getName(), passwordRecoveryManager, null);
// Registering missing challenge question handler as a post authn handler
PostAuthenticationHandler postAuthnMissingChallengeQuestions = PostAuthnMissingChallengeQuestionsHandler.getInstance();
bundleContext.registerService(PostAuthenticationHandler.class.getName(), postAuthnMissingChallengeQuestions, null);
bundleContext.registerService(AbstractEventHandler.class.getName(), new ChallengeAnswerValidationHandler(), null);
} catch (Exception e) {
log.error("Error while activating identity governance component.", e);
}
// register the tenant management listener
TenantMgtListener tenantMgtListener = new TenantManagementListener();
context.getBundleContext().registerService(TenantMgtListener.class.getName(), tenantMgtListener, null);
// register default challenge questions
try {
if (log.isDebugEnabled()) {
log.debug("Loading default challenge questions for super tenant.");
}
loadDefaultChallengeQuestions();
// new ChallengeQuestionManager().getAllChallengeQuestions("carbon.super", "lk_LK");
} catch (IdentityRecoveryException e) {
log.error("Error persisting challenge question for super tenant.", e);
}
}
Aggregations