From 3ae0de099fde07e45442fb28503b264e95d2b5d2 Mon Sep 17 00:00:00 2001 From: Asha Sulaiman <165079T@uom.lk> Date: Thu, 30 Nov 2023 14:13:48 +0530 Subject: [PATCH] Revert "Remove challenge questions related configs" --- .../connector/RecoveryConfigImpl.java | 104 ++++++++++++++++++ .../connector/RecoveryConfigImplTest.java | 48 ++++++++ 2 files changed, 152 insertions(+) diff --git a/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/connector/RecoveryConfigImpl.java b/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/connector/RecoveryConfigImpl.java index 643b56dd57..f47ca47e44 100644 --- a/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/connector/RecoveryConfigImpl.java +++ b/components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/connector/RecoveryConfigImpl.java @@ -88,6 +88,14 @@ public Map getPropertyNameMapping() { "Manage notifications sending internally"); nameMapping.put(IdentityRecoveryConstants.ConnectorConfig.PASSWORD_RECOVERY_RECAPTCHA_ENABLE, "Enable reCaptcha for password recovery"); + nameMapping.put(IdentityRecoveryConstants.ConnectorConfig.QUESTION_BASED_PW_RECOVERY, + "Security question based password recovery"); + nameMapping.put(IdentityRecoveryConstants.ConnectorConfig.CHALLENGE_QUESTION_ANSWER_REGEX, + "Security question answer regex"); + nameMapping.put(IdentityRecoveryConstants.ConnectorConfig.ENFORCE_CHALLENGE_QUESTION_ANSWER_UNIQUENESS, + "Enforce security question answer uniqueness"); + nameMapping.put(IdentityRecoveryConstants.ConnectorConfig.QUESTION_MIN_NO_ANSWER, "Number of questions " + + "required for password recovery"); nameMapping.put(IdentityRecoveryConstants.ConnectorConfig.USERNAME_RECOVERY_ENABLE, "Username recovery"); nameMapping.put(IdentityRecoveryConstants.ConnectorConfig.USERNAME_RECOVERY_RECAPTCHA_ENABLE, "Enable reCaptcha for username recovery"); @@ -96,10 +104,18 @@ public Map getPropertyNameMapping() { "SMS OTP expiry time"); nameMapping.put(IdentityRecoveryConstants.ConnectorConfig.NOTIFICATION_SEND_RECOVERY_NOTIFICATION_SUCCESS, "Notify when recovery success"); + nameMapping.put(IdentityRecoveryConstants.ConnectorConfig.NOTIFICATION_SEND_RECOVERY_SECURITY_START, + "Notify when security questions based recovery starts"); + nameMapping.put(IdentityRecoveryConstants.ConnectorConfig.RECOVERY_QUESTION_PASSWORD_RECAPTCHA_ENABLE, + "Enable reCaptcha for security questions based password recovery"); nameMapping.put( IdentityRecoveryConstants.ConnectorConfig.RECOVERY_QUESTION_PASSWORD_RECAPTCHA_MAX_FAILED_ATTEMPTS, "Max failed attempts for reCaptcha"); + nameMapping.put(IdentityRecoveryConstants.ConnectorConfig.FORCE_ADD_PW_RECOVERY_QUESTION, "Enable forced " + + "security questions"); + nameMapping.put(IdentityRecoveryConstants.ConnectorConfig.FORCE_MIN_NO_QUESTION_ANSWERED, + "Minimum number of forced security questions to be answered"); nameMapping.put(IdentityRecoveryConstants.ConnectorConfig.RECOVERY_CALLBACK_REGEX, "Recovery callback URL regex"); nameMapping.put(IdentityRecoveryConstants.ConnectorConfig.ENABLE_AUTO_LGOIN_AFTER_PASSWORD_RESET, @@ -129,6 +145,17 @@ public Map getPropertyDescriptionMapping() { "Enable to include numbers in SMS and e-mail OTPs."); descriptionMapping.put(IdentityRecoveryConstants.ConnectorConfig.PASSWORD_RECOVERY_OTP_LENGTH, "Length of the OTP for SMS and e-mail verifications. OTP length must be 4-10."); + descriptionMapping.put(IdentityRecoveryConstants.ConnectorConfig.CHALLENGE_QUESTION_ANSWER_REGEX, + "Security question answer regex"); + descriptionMapping.put(IdentityRecoveryConstants.ConnectorConfig.ENFORCE_CHALLENGE_QUESTION_ANSWER_UNIQUENESS, + "Enforce security question answer uniqueness"); + descriptionMapping.put(IdentityRecoveryConstants.ConnectorConfig.RECOVERY_QUESTION_PASSWORD_RECAPTCHA_ENABLE, + "Prompt reCaptcha for security question based password recovery"); + descriptionMapping.put(IdentityRecoveryConstants.ConnectorConfig.FORCE_ADD_PW_RECOVERY_QUESTION, + "Force users to provide answers to security questions during sign in"); + descriptionMapping.put(IdentityRecoveryConstants.ConnectorConfig.FORCE_MIN_NO_QUESTION_ANSWERED, + "Force users to provide answers to security questions during sign in " + + "if user has answered lesser than this value"); descriptionMapping.put(IdentityRecoveryConstants.ConnectorConfig.RECOVERY_CALLBACK_REGEX, "Recovery callback URL regex"); descriptionMapping.put(IdentityRecoveryConstants.ConnectorConfig.PASSWORD_RECOVERY_SMS_OTP_EXPIRY_TIME, @@ -150,13 +177,20 @@ public String[] getPropertyNames() { properties.add(IdentityRecoveryConstants.ConnectorConfig.PASSWORD_RECOVERY_OTP_LENGTH); properties.add(IdentityRecoveryConstants.ConnectorConfig.PASSWORD_RECOVERY_RECAPTCHA_ENABLE); properties.add(IdentityRecoveryConstants.ConnectorConfig.QUESTION_BASED_PW_RECOVERY); + properties.add(IdentityRecoveryConstants.ConnectorConfig.QUESTION_MIN_NO_ANSWER); + properties.add(IdentityRecoveryConstants.ConnectorConfig.CHALLENGE_QUESTION_ANSWER_REGEX); + properties.add(IdentityRecoveryConstants.ConnectorConfig.ENFORCE_CHALLENGE_QUESTION_ANSWER_UNIQUENESS); + properties.add(IdentityRecoveryConstants.ConnectorConfig.RECOVERY_QUESTION_PASSWORD_RECAPTCHA_ENABLE); properties.add(IdentityRecoveryConstants.ConnectorConfig.RECOVERY_QUESTION_PASSWORD_RECAPTCHA_MAX_FAILED_ATTEMPTS); properties.add(IdentityRecoveryConstants.ConnectorConfig.USERNAME_RECOVERY_ENABLE); properties.add(IdentityRecoveryConstants.ConnectorConfig.USERNAME_RECOVERY_RECAPTCHA_ENABLE); properties.add(IdentityRecoveryConstants.ConnectorConfig.NOTIFICATION_INTERNALLY_MANAGE); properties.add(IdentityRecoveryConstants.ConnectorConfig.NOTIFICATION_SEND_RECOVERY_NOTIFICATION_SUCCESS); + properties.add(IdentityRecoveryConstants.ConnectorConfig.NOTIFICATION_SEND_RECOVERY_SECURITY_START); properties.add(IdentityRecoveryConstants.ConnectorConfig.EXPIRY_TIME); properties.add(IdentityRecoveryConstants.ConnectorConfig.PASSWORD_RECOVERY_SMS_OTP_EXPIRY_TIME); + properties.add(IdentityRecoveryConstants.ConnectorConfig.FORCE_ADD_PW_RECOVERY_QUESTION); + properties.add(IdentityRecoveryConstants.ConnectorConfig.FORCE_MIN_NO_QUESTION_ANSWERED); properties.add(IdentityRecoveryConstants.ConnectorConfig.RECOVERY_CALLBACK_REGEX); properties.add(IdentityRecoveryConstants.ConnectorConfig.ENABLE_AUTO_LGOIN_AFTER_PASSWORD_RESET); properties.add(IdentityRecoveryConstants.ConnectorConfig.RECOVERY_NOTIFICATION_PASSWORD_MAX_FAILED_ATTEMPTS); @@ -208,6 +242,14 @@ public Properties getDefaultPropertyValues(String tenantDomain) throws IdentityG IdentityRecoveryConstants.ConnectorConfig.PASSWORD_RECOVERY_OTP_LENGTH); String questionBasedPasswordRecovery = IdentityUtil.getProperty( IdentityRecoveryConstants.ConnectorConfig.QUESTION_BASED_PW_RECOVERY); + String miniMumAnswerProperty = IdentityUtil.getProperty( + IdentityRecoveryConstants.ConnectorConfig.QUESTION_MIN_NO_ANSWER); + String challengeQuestionAnswerRegexProperty = IdentityUtil.getProperty( + IdentityRecoveryConstants.ConnectorConfig.CHALLENGE_QUESTION_ANSWER_REGEX); + String challengeQuestionAnswerUniquenessProperty = IdentityUtil.getProperty( + IdentityRecoveryConstants.ConnectorConfig.ENFORCE_CHALLENGE_QUESTION_ANSWER_UNIQUENESS); + String recoveryQuestionPasswordReCaptcha = IdentityUtil.getProperty( + IdentityRecoveryConstants.ConnectorConfig.RECOVERY_QUESTION_PASSWORD_RECAPTCHA_ENABLE); String passwordReCaptchaMaxFailedAttempts = IdentityUtil.getProperty(IdentityRecoveryConstants. ConnectorConfig.RECOVERY_QUESTION_PASSWORD_RECAPTCHA_MAX_FAILED_ATTEMPTS); String usernameRecovery = IdentityUtil.getProperty( @@ -219,6 +261,12 @@ public Properties getDefaultPropertyValues(String tenantDomain) throws IdentityG .getProperty(IdentityRecoveryConstants.ConnectorConfig.PASSWORD_RECOVERY_SMS_OTP_EXPIRY_TIME); String notifySuccessProperty = IdentityUtil.getProperty( IdentityRecoveryConstants.ConnectorConfig.NOTIFICATION_SEND_RECOVERY_NOTIFICATION_SUCCESS); + String notifyStartProperty = IdentityUtil.getProperty( + IdentityRecoveryConstants.ConnectorConfig.NOTIFICATION_SEND_RECOVERY_SECURITY_START); + String forceChallengeQuestionsProperty = IdentityUtil.getProperty( + IdentityRecoveryConstants.ConnectorConfig.FORCE_ADD_PW_RECOVERY_QUESTION); + String minimumForcedChallengeQuestionsAnsweredProperty = IdentityUtil + .getProperty(IdentityRecoveryConstants.ConnectorConfig.FORCE_MIN_NO_QUESTION_ANSWERED); String passwordRecoveryReCaptcha = IdentityUtil.getProperty(IdentityRecoveryConstants.ConnectorConfig. PASSWORD_RECOVERY_RECAPTCHA_ENABLE); String userNameRecoveryReCaptcha = IdentityUtil.getProperty(IdentityRecoveryConstants.ConnectorConfig. @@ -256,9 +304,21 @@ public Properties getDefaultPropertyValues(String tenantDomain) throws IdentityG if (StringUtils.isNotEmpty(questionBasedPasswordRecovery)) { enableQuestionBasedPasswordRecovery = questionBasedPasswordRecovery; } + if (StringUtils.isNotEmpty(challengeQuestionAnswerRegexProperty)) { + challengeQuestionAnswerRegex = challengeQuestionAnswerRegexProperty; + } + if (StringUtils.isNotEmpty(challengeQuestionAnswerUniquenessProperty)) { + enforceChallengeQuestionAnswerUniqueness = challengeQuestionAnswerUniquenessProperty; + } if (StringUtils.isNotEmpty(notificationInternallyManged)) { enableNotificationInternallyManage = notificationInternallyManged; } + if (StringUtils.isNotEmpty(miniMumAnswerProperty)) { + minimumAnswers = miniMumAnswerProperty; + } + if (StringUtils.isNotEmpty(recoveryQuestionPasswordReCaptcha)) { + enableRecoveryQuestionPasswordReCaptcha = recoveryQuestionPasswordReCaptcha; + } if (StringUtils.isNotEmpty(passwordReCaptchaMaxFailedAttempts)) { recoveryQuestionPasswordReCaptchaMaxFailedAttempts = passwordReCaptchaMaxFailedAttempts; } @@ -271,6 +331,15 @@ public Properties getDefaultPropertyValues(String tenantDomain) throws IdentityG if (StringUtils.isNotEmpty(notifySuccessProperty)) { notifySuccess = notifySuccessProperty; } + if (StringUtils.isNotEmpty(notifyStartProperty)) { + notifyStart = notifyStartProperty; + } + if (StringUtils.isNotEmpty(forceChallengeQuestionsProperty)) { + enableForceChallengeQuestions = forceChallengeQuestionsProperty; + } + if (StringUtils.isNotEmpty(minimumForcedChallengeQuestionsAnsweredProperty)) { + minimumForcedChallengeQuestionsAnswered = minimumForcedChallengeQuestionsAnsweredProperty; + } if (StringUtils.isNotEmpty(passwordRecoveryReCaptcha)) { enablePasswordRecoveryReCaptcha = passwordRecoveryReCaptcha; } @@ -307,6 +376,14 @@ public Properties getDefaultPropertyValues(String tenantDomain) throws IdentityG enablePasswordRecoveryReCaptcha); defaultProperties.put(IdentityRecoveryConstants.ConnectorConfig.QUESTION_BASED_PW_RECOVERY, enableQuestionBasedPasswordRecovery); + defaultProperties.put(IdentityRecoveryConstants.ConnectorConfig.QUESTION_MIN_NO_ANSWER, + minimumAnswers); + defaultProperties.put(IdentityRecoveryConstants.ConnectorConfig.CHALLENGE_QUESTION_ANSWER_REGEX, + challengeQuestionAnswerRegex); + defaultProperties.put(IdentityRecoveryConstants.ConnectorConfig.ENFORCE_CHALLENGE_QUESTION_ANSWER_UNIQUENESS, + enforceChallengeQuestionAnswerUniqueness); + defaultProperties.put(IdentityRecoveryConstants.ConnectorConfig.RECOVERY_QUESTION_PASSWORD_RECAPTCHA_ENABLE, + enableRecoveryQuestionPasswordReCaptcha); defaultProperties.put(IdentityRecoveryConstants.ConnectorConfig .RECOVERY_QUESTION_PASSWORD_RECAPTCHA_MAX_FAILED_ATTEMPTS, recoveryQuestionPasswordReCaptchaMaxFailedAttempts); @@ -321,6 +398,12 @@ public Properties getDefaultPropertyValues(String tenantDomain) throws IdentityG .put(IdentityRecoveryConstants.ConnectorConfig.PASSWORD_RECOVERY_SMS_OTP_EXPIRY_TIME, expiryTimeSMSOTP); defaultProperties.put(IdentityRecoveryConstants.ConnectorConfig.NOTIFICATION_SEND_RECOVERY_NOTIFICATION_SUCCESS, notifySuccess); + defaultProperties.put(IdentityRecoveryConstants.ConnectorConfig.NOTIFICATION_SEND_RECOVERY_SECURITY_START, + notifyStart); + defaultProperties.put(IdentityRecoveryConstants.ConnectorConfig.FORCE_ADD_PW_RECOVERY_QUESTION, + enableForceChallengeQuestions); + defaultProperties.put(IdentityRecoveryConstants.ConnectorConfig.FORCE_MIN_NO_QUESTION_ANSWERED, + minimumForcedChallengeQuestionsAnswered); defaultProperties.put(IdentityRecoveryConstants.ConnectorConfig.RECOVERY_CALLBACK_REGEX, recoveryCallbackRegex); defaultProperties.put(IdentityRecoveryConstants.ConnectorConfig.ENABLE_AUTO_LGOIN_AFTER_PASSWORD_RESET, enableAdminPasswordResetAutoLoginProperty); @@ -370,6 +453,15 @@ public Map getMetaData() { meta.put(IdentityRecoveryConstants.ConnectorConfig.QUESTION_BASED_PW_RECOVERY, getPropertyObject(IdentityMgtConstants.DataTypes.BOOLEAN.getValue())); + meta.put(IdentityRecoveryConstants.ConnectorConfig.QUESTION_MIN_NO_ANSWER, + getPropertyObject(IdentityMgtConstants.DataTypes.INTEGER.getValue())); + + meta.put(IdentityRecoveryConstants.ConnectorConfig.ENFORCE_CHALLENGE_QUESTION_ANSWER_UNIQUENESS, + getPropertyObject(IdentityMgtConstants.DataTypes.BOOLEAN.getValue())); + + meta.put(IdentityRecoveryConstants.ConnectorConfig.RECOVERY_QUESTION_PASSWORD_RECAPTCHA_ENABLE, + getPropertyObject(IdentityMgtConstants.DataTypes.BOOLEAN.getValue())); + meta.put(IdentityRecoveryConstants.ConnectorConfig.RECOVERY_QUESTION_PASSWORD_RECAPTCHA_MAX_FAILED_ATTEMPTS, getPropertyObject(IdentityMgtConstants.DataTypes.INTEGER.getValue())); @@ -391,9 +483,21 @@ public Map getMetaData() { meta.put(IdentityRecoveryConstants.ConnectorConfig.NOTIFICATION_SEND_RECOVERY_NOTIFICATION_SUCCESS, getPropertyObject(IdentityMgtConstants.DataTypes.BOOLEAN.getValue())); + meta.put(IdentityRecoveryConstants.ConnectorConfig.NOTIFICATION_SEND_RECOVERY_SECURITY_START, + getPropertyObject(IdentityMgtConstants.DataTypes.BOOLEAN.getValue())); + + meta.put(IdentityRecoveryConstants.ConnectorConfig.FORCE_ADD_PW_RECOVERY_QUESTION, + getPropertyObject(IdentityMgtConstants.DataTypes.BOOLEAN.getValue())); + + meta.put(IdentityRecoveryConstants.ConnectorConfig.FORCE_MIN_NO_QUESTION_ANSWERED, + getPropertyObject(IdentityMgtConstants.DataTypes.INTEGER.getValue())); + meta.put(IdentityRecoveryConstants.ConnectorConfig.ENABLE_AUTO_LGOIN_AFTER_PASSWORD_RESET, getPropertyObject(IdentityMgtConstants.DataTypes.BOOLEAN.getValue())); + meta.put(IdentityRecoveryConstants.ConnectorConfig.CHALLENGE_QUESTION_ANSWER_REGEX, + getPropertyObject(IdentityMgtConstants.DataTypes.STRING.getValue())); + meta.put(IdentityRecoveryConstants.ConnectorConfig.RECOVERY_CALLBACK_REGEX, getPropertyObject(IdentityMgtConstants.DataTypes.STRING.getValue())); diff --git a/components/org.wso2.carbon.identity.recovery/src/test/java/org/wso2/carbon/identity/recovery/connector/RecoveryConfigImplTest.java b/components/org.wso2.carbon.identity.recovery/src/test/java/org/wso2/carbon/identity/recovery/connector/RecoveryConfigImplTest.java index f0a52b87dc..6e5ba38800 100644 --- a/components/org.wso2.carbon.identity.recovery/src/test/java/org/wso2/carbon/identity/recovery/connector/RecoveryConfigImplTest.java +++ b/components/org.wso2.carbon.identity.recovery/src/test/java/org/wso2/carbon/identity/recovery/connector/RecoveryConfigImplTest.java @@ -96,6 +96,14 @@ public void testGetPropertyNameMapping() { "Manage notifications sending internally"); nameMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.PASSWORD_RECOVERY_RECAPTCHA_ENABLE, "Enable reCaptcha for password recovery"); + nameMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.QUESTION_BASED_PW_RECOVERY, + "Security question based password recovery"); + nameMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.CHALLENGE_QUESTION_ANSWER_REGEX, + "Security question answer regex"); + nameMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.ENFORCE_CHALLENGE_QUESTION_ANSWER_UNIQUENESS, + "Enforce security question answer uniqueness"); + nameMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.QUESTION_MIN_NO_ANSWER, "Number of " + + "questions required for password recovery"); nameMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.USERNAME_RECOVERY_ENABLE, "Username recovery"); nameMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.USERNAME_RECOVERY_RECAPTCHA_ENABLE, "Enable reCaptcha for username recovery"); @@ -105,10 +113,18 @@ public void testGetPropertyNameMapping() { "SMS OTP expiry time"); nameMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.NOTIFICATION_SEND_RECOVERY_NOTIFICATION_SUCCESS, "Notify when recovery success"); + nameMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.NOTIFICATION_SEND_RECOVERY_SECURITY_START, + "Notify when security questions based recovery starts"); + nameMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.RECOVERY_QUESTION_PASSWORD_RECAPTCHA_ENABLE, + "Enable reCaptcha for security questions based password recovery"); nameMappingExpected.put( IdentityRecoveryConstants.ConnectorConfig.RECOVERY_QUESTION_PASSWORD_RECAPTCHA_MAX_FAILED_ATTEMPTS, "Max failed attempts for reCaptcha"); + nameMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.FORCE_ADD_PW_RECOVERY_QUESTION, "Enable forced " + + "security questions"); + nameMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.FORCE_MIN_NO_QUESTION_ANSWERED, + "Minimum number of forced security questions to be answered"); nameMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.RECOVERY_CALLBACK_REGEX, "Recovery callback URL regex"); nameMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.ENABLE_AUTO_LGOIN_AFTER_PASSWORD_RESET, @@ -141,6 +157,17 @@ public void testGetPropertyDescriptionMapping() { "Enable to include numbers in SMS and e-mail OTPs."); descriptionMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.PASSWORD_RECOVERY_OTP_LENGTH, "Length of the OTP for SMS and e-mail verifications. OTP length must be 4-10."); + descriptionMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.CHALLENGE_QUESTION_ANSWER_REGEX, + "Security question answer regex"); + descriptionMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.ENFORCE_CHALLENGE_QUESTION_ANSWER_UNIQUENESS, + "Enforce security question answer uniqueness"); + descriptionMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.RECOVERY_QUESTION_PASSWORD_RECAPTCHA_ENABLE, + "Prompt reCaptcha for security question based password recovery"); + descriptionMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.FORCE_ADD_PW_RECOVERY_QUESTION, + "Force users to provide answers to security questions during sign in"); + descriptionMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.FORCE_MIN_NO_QUESTION_ANSWERED, + "Force users to provide answers to security questions during sign in " + + "if user has answered lesser than this value"); descriptionMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.RECOVERY_CALLBACK_REGEX, "Recovery callback URL regex"); descriptionMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.PASSWORD_RECOVERY_SMS_OTP_EXPIRY_TIME, @@ -164,13 +191,20 @@ public void testGetPropertyNames() { propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.PASSWORD_RECOVERY_OTP_LENGTH); propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.PASSWORD_RECOVERY_RECAPTCHA_ENABLE); propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.QUESTION_BASED_PW_RECOVERY); + propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.QUESTION_MIN_NO_ANSWER); + propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.CHALLENGE_QUESTION_ANSWER_REGEX); + propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.ENFORCE_CHALLENGE_QUESTION_ANSWER_UNIQUENESS); + propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.RECOVERY_QUESTION_PASSWORD_RECAPTCHA_ENABLE); propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.RECOVERY_QUESTION_PASSWORD_RECAPTCHA_MAX_FAILED_ATTEMPTS); propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.USERNAME_RECOVERY_ENABLE); propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.USERNAME_RECOVERY_RECAPTCHA_ENABLE); propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.NOTIFICATION_INTERNALLY_MANAGE); propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.NOTIFICATION_SEND_RECOVERY_NOTIFICATION_SUCCESS); + propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.NOTIFICATION_SEND_RECOVERY_SECURITY_START); propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.EXPIRY_TIME); propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.PASSWORD_RECOVERY_SMS_OTP_EXPIRY_TIME); + propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.FORCE_ADD_PW_RECOVERY_QUESTION); + propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.FORCE_MIN_NO_QUESTION_ANSWERED); propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.RECOVERY_CALLBACK_REGEX); propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.ENABLE_AUTO_LGOIN_AFTER_PASSWORD_RESET); @@ -231,6 +265,10 @@ public void testGetDefaultPropertyValues() throws IdentityGovernanceException { enablePasswordRecoveryReCaptcha); defaultPropertiesExpected.put(IdentityRecoveryConstants.ConnectorConfig.QUESTION_BASED_PW_RECOVERY, testEnableQuestionBasedPasswordRecovery); + defaultPropertiesExpected.put(IdentityRecoveryConstants.ConnectorConfig.QUESTION_MIN_NO_ANSWER, + testMinimumAnswers); + defaultPropertiesExpected.put(IdentityRecoveryConstants.ConnectorConfig.RECOVERY_QUESTION_PASSWORD_RECAPTCHA_ENABLE, + testEnableRecoveryQuestionPasswordReCaptcha); defaultPropertiesExpected.put(IdentityRecoveryConstants.ConnectorConfig .RECOVERY_QUESTION_PASSWORD_RECAPTCHA_MAX_FAILED_ATTEMPTS, testRecoveryQuestionPasswordReCaptchaMaxFailedAttempts); @@ -245,8 +283,18 @@ public void testGetDefaultPropertyValues() throws IdentityGovernanceException { testExpiryTimeSMSOTP); defaultPropertiesExpected.put(IdentityRecoveryConstants.ConnectorConfig.NOTIFICATION_SEND_RECOVERY_NOTIFICATION_SUCCESS, testNotifySuccess); + defaultPropertiesExpected.put(IdentityRecoveryConstants.ConnectorConfig.NOTIFICATION_SEND_RECOVERY_SECURITY_START, + testNotifyStart); + defaultPropertiesExpected.put(IdentityRecoveryConstants.ConnectorConfig.FORCE_ADD_PW_RECOVERY_QUESTION, + testForceChallengeQuestions); + defaultPropertiesExpected.put(IdentityRecoveryConstants.ConnectorConfig.FORCE_MIN_NO_QUESTION_ANSWERED, + testMinimumForcedChallengeQuestionsAnswered); defaultPropertiesExpected.put(IdentityRecoveryConstants.ConnectorConfig.RECOVERY_CALLBACK_REGEX, recoveryCallbackRegex); + defaultPropertiesExpected.put(IdentityRecoveryConstants.ConnectorConfig.CHALLENGE_QUESTION_ANSWER_REGEX, + challengeQuestionAnswerRegex); + defaultPropertiesExpected.put(IdentityRecoveryConstants.ConnectorConfig. + ENFORCE_CHALLENGE_QUESTION_ANSWER_UNIQUENESS, enforceChallengeQuestionAnswerUniqueness); defaultPropertiesExpected.put(IdentityRecoveryConstants.ConnectorConfig. ENABLE_AUTO_LGOIN_AFTER_PASSWORD_RESET, enableAutoLoginAfterPasswordReset); defaultPropertiesExpected.put(IdentityRecoveryConstants.ConnectorConfig.