Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,8 @@ public static class ConnectorConfig {
public static final String EMAIL_VERIFICATION_NOTIFICATION_INTERNALLY_MANAGE = "EmailVerification.Notification.InternallyManage";
public static final String EMAIL_VERIFICATION_NOTIFICATION_ACCOUNT_ACTIVATION = "EmailVerification.AskPassword" +
".AccountActivation";
public static final String EMAIL_VERIFICATION_DISABLE_NOTIFY_UNLOCK_STATE =
"EmailVerification.DisableNotifyUnlockState";

public static final String TENANT_ADMIN_ASK_PASSWORD_EXPIRY_TIME = "TenantRegistrationVerification." +
"AskPassword.ExpiryTime";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ public Map<String, String> getPropertyNameMapping() {
"Manage notifications sending internally");
nameMapping.put(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_NOTIFICATION_ACCOUNT_ACTIVATION,
"Send account activation email");
nameMapping.put(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_DISABLE_NOTIFY_UNLOCK_STATE,
"Disable account unlock email on email verification");
nameMapping.put(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_EXPIRY_TIME,
"Email verification code expiry time");
nameMapping.put(IdentityRecoveryConstants.ConnectorConfig.ASK_PASSWORD_EXPIRY_TIME,
Expand Down Expand Up @@ -148,6 +150,8 @@ public Map<String, String> getPropertyDescriptionMapping() {
"Disable if the client application handles notification sending.");
descriptionMapping.put(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_NOTIFICATION_ACCOUNT_ACTIVATION,
"Disable if account activation confirmation email is not required.");
descriptionMapping.put(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_DISABLE_NOTIFY_UNLOCK_STATE,
"Disable the account unlock email that is sent when the user confirms the email verification.");
descriptionMapping.put(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_EXPIRY_TIME,
"Set the time span that the verification e-mail would be valid, in minutes. (For infinite validity " +
"period, set -1)");
Expand Down Expand Up @@ -177,6 +181,7 @@ public String[] getPropertyNames() {
properties.add(IdentityRecoveryConstants.ConnectorConfig.EMAIL_ACCOUNT_LOCK_ON_CREATION);
properties.add(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_NOTIFICATION_INTERNALLY_MANAGE);
properties.add(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_NOTIFICATION_ACCOUNT_ACTIVATION);
properties.add(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_DISABLE_NOTIFY_UNLOCK_STATE);
properties.add(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_EXPIRY_TIME);
properties.add(IdentityRecoveryConstants.ConnectorConfig.ASK_PASSWORD_EXPIRY_TIME);
properties.add(IdentityRecoveryConstants.ConnectorConfig.ASK_PASSWORD_TEMP_PASSWORD_GENERATOR);
Expand All @@ -198,6 +203,7 @@ public Properties getDefaultPropertyValues(String tenantDomain) throws IdentityG
String useNumbersInOTP = "true";
String otpLength = "6";
String enableEmailAccountLockOnCreation = "true";
String disableNotifyUnlockState = "false";
Comment thread
sadilchamishka marked this conversation as resolved.
String enableNotificationInternallyManage = "true";
String sentNotificationOnAccountActivation = "true";
String emailVerificationCodeExpiry = "1440";
Expand Down Expand Up @@ -234,6 +240,8 @@ public Properties getDefaultPropertyValues(String tenantDomain) throws IdentityG
IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_NOTIFICATION_INTERNALLY_MANAGE);
String notificationOnAccountActivationProperty = IdentityUtil.getProperty(
IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_NOTIFICATION_ACCOUNT_ACTIVATION);
String disableNotifyUnlockStateProperty = IdentityUtil.getProperty(
IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_DISABLE_NOTIFY_UNLOCK_STATE);

if (StringUtils.isNotEmpty(emailVerificationProperty)) {
enableEmailVerification = emailVerificationProperty;
Expand Down Expand Up @@ -271,6 +279,9 @@ public Properties getDefaultPropertyValues(String tenantDomain) throws IdentityG
if (StringUtils.isNotEmpty(notificationOnAccountActivationProperty)) {
sentNotificationOnAccountActivation = notificationOnAccountActivationProperty;
}
if (StringUtils.isNotEmpty(disableNotifyUnlockStateProperty)) {
disableNotifyUnlockState = disableNotifyUnlockStateProperty;
}
if (StringUtils.isNotEmpty(emailVerificationCodeExpiryProperty)) {
emailVerificationCodeExpiry = emailVerificationCodeExpiryProperty;
}
Expand Down Expand Up @@ -310,6 +321,8 @@ public Properties getDefaultPropertyValues(String tenantDomain) throws IdentityG
enableNotificationInternallyManage);
defaultProperties.put(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_NOTIFICATION_ACCOUNT_ACTIVATION,
sentNotificationOnAccountActivation);
defaultProperties.put(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_DISABLE_NOTIFY_UNLOCK_STATE,
disableNotifyUnlockState);
defaultProperties.put(IdentityRecoveryConstants.ConnectorConfig.ASK_PASSWORD_TEMP_PASSWORD_GENERATOR,
askPasswordTempPassExtension);
try {
Expand Down Expand Up @@ -375,6 +388,9 @@ public Map<String, Property> getMetaData() {
meta.put(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_NOTIFICATION_INTERNALLY_MANAGE,
getPropertyObject(IdentityMgtConstants.DataTypes.BOOLEAN.getValue()));

meta.put(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_DISABLE_NOTIFY_UNLOCK_STATE,
getPropertyObject(IdentityMgtConstants.DataTypes.BOOLEAN.getValue()));
Comment thread
sadilchamishka marked this conversation as resolved.

meta.put(IdentityRecoveryConstants.ConnectorConfig.ASK_PASSWORD_TEMP_PASSWORD_GENERATOR,
getPropertyObject(IdentityMgtConstants.DataTypes.STRING.getValue()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ public void testGetPropertyNameMapping() {
"Manage notifications sending internally");
nameMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_NOTIFICATION_ACCOUNT_ACTIVATION,
"Send account activation email");
nameMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_DISABLE_NOTIFY_UNLOCK_STATE,
"Disable account unlock email on email verification");
nameMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_EXPIRY_TIME,
"Email verification code expiry time");
nameMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.ASK_PASSWORD_EXPIRY_TIME,
Expand Down Expand Up @@ -158,6 +160,8 @@ public void testGetPropertyDescriptionMapping() {
descriptionMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.
EMAIL_VERIFICATION_NOTIFICATION_ACCOUNT_ACTIVATION,
"Disable if account activation confirmation email is not required.");
descriptionMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_DISABLE_NOTIFY_UNLOCK_STATE,
"Disable the account unlock email that is sent when the user confirms the email verification.");
descriptionMappingExpected.put(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_EXPIRY_TIME,
"Set the time span that the verification e-mail would be valid, in minutes. (For infinite validity " +
"period, set -1)");
Expand Down Expand Up @@ -190,6 +194,7 @@ public void testGetPropertyNames() {
propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.EMAIL_ACCOUNT_LOCK_ON_CREATION);
propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_NOTIFICATION_INTERNALLY_MANAGE);
propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_NOTIFICATION_ACCOUNT_ACTIVATION);
propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_DISABLE_NOTIFY_UNLOCK_STATE);
propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_EXPIRY_TIME);
propertiesExpected.add(IdentityRecoveryConstants.ConnectorConfig.ASK_PASSWORD_EXPIRY_TIME);
String[] propertiesArrayExpected = propertiesExpected.toArray(new String[0]);
Expand Down Expand Up @@ -217,6 +222,7 @@ public void testGetDefaultPropertyValues() throws IdentityGovernanceException {
String testEnableEmailAccountLockOnCreation = "true";
String testEnableNotificationInternallyManage = "true";
String testSentNotificationOnAccountActivation = "true";
String testDisableNotifyUnlockState = "false";
String testEmailVerificationCodeExpiry = "1440";
String testAskPasswordCodeExpiry = "1440";
String testAskPasswordTempPassExtension = "org.wso2.carbon.user.mgt.common.DefaultPasswordGenerator";
Expand Down Expand Up @@ -250,6 +256,8 @@ public void testGetDefaultPropertyValues() throws IdentityGovernanceException {
testEnableNotificationInternallyManage);
defaultPropertiesExpected.put(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_NOTIFICATION_ACCOUNT_ACTIVATION,
testSentNotificationOnAccountActivation);
defaultPropertiesExpected.put(IdentityRecoveryConstants.ConnectorConfig.EMAIL_VERIFICATION_DISABLE_NOTIFY_UNLOCK_STATE,
testDisableNotifyUnlockState);
defaultPropertiesExpected.put(IdentityRecoveryConstants.ConnectorConfig.ASK_PASSWORD_TEMP_PASSWORD_GENERATOR,
testAskPasswordTempPassExtension);
try {
Expand Down
Loading