Add EnableEmailUserName Boolean return method to IdentityUtil
@@ -107,6 +107,7 @@ public class IdentityUtil {
"[^<>:\"/\\\\|?*\\x00-\\x1F]*[^<>:\"/\\\\|?*\\x00-\\x1F\\ .]$";
private static final String ENABLE_RECOVERY_ENDPOINT = "EnableRecoveryEndpoint";
private static final String ENABLE_SELF_SIGN_UP_ENDPOINT = "EnableSelfSignUpEndpoint";
+ private static final String ENABLE_EMAIL_USERNAME = "EnableEmailUserName";
private static Log log = LogFactory.getLog(IdentityUtil.class);
private static Map<String, Object> configuration = new HashMap<>();
private static Map<IdentityEventListenerConfigKey, IdentityEventListenerConfig> eventListenerConfiguration = new
@@ -1059,6 +1060,19 @@ public class IdentityUtil {
return false;
}
+ /**
+ * Returns whether the email based username is enabled or not
+ *
+ * @return true if the EnableEmailUserName. False if it doesnt
+ */
+ public static boolean isEmailUsernameEnabled() {
+ String enableEmailUsernameProperty = getProperty(ENABLE_EMAIL_USERNAME);
+ if (StringUtils.isNotBlank(enableEmailUsernameProperty)) {
+ return Boolean.parseBoolean(enableEmailUsernameProperty);
+ }
+ return false;
+ }
+
/**
*
* Converts and returns a {@link Certificate} object for given PEM content.
