@Override public void setEmail(String email) { email = KeycloakModelUtils.toLowerCaseSafe(email); user.setEmail(email, realm.isDuplicateEmailsAllowed()); }
@Override public boolean isDuplicateEmailsAllowed() { if (isUpdated()) return updated.isDuplicateEmailsAllowed(); return cached.isDuplicateEmailsAllowed(); }
@Override public void setEmail(String email) { email = KeycloakModelUtils.toLowerCaseSafe(email); user.setEmail(email, realm.isDuplicateEmailsAllowed()); updateUser(); }
protected void ensureEmailConstraint(List<UserEntity> users, RealmModel realm) { UserEntity user = users.get(0); if (users.size() > 1) { // Realm settings have been changed from allowing duplicate emails to not allowing them // but duplicates haven't been removed. throw new ModelDuplicateException("Multiple users with email '" + user.getEmail() + "' exist in Keycloak."); } if (realm.isDuplicateEmailsAllowed()) { return; } if (user.getEmail() != null && !user.getEmail().equals(user.getEmailConstraint())) { // Realm settings have been changed from allowing duplicate emails to not allowing them. // We need to update the email constraint to reflect this change in the user entities. user.setEmailConstraint(user.getEmail()); em.persist(user); } }
protected void ensureEmailConstraint(List<MongoUserEntity> users, RealmModel realm) { MongoUserEntity user = users.get(0); if (users.size() > 1) { // Realm settings have been changed from allowing duplicate emails to not allowing them // but duplicates haven't been removed. throw new ModelDuplicateException("Multiple users with email '" + user.getEmail() + "' exist in Keycloak."); } if (realm.isDuplicateEmailsAllowed()) { return; } if (user.getEmail() != null && user.getEmailIndex() == null) { // Realm settings have been changed from allowing duplicate emails to not allowing them. // We need to update the email index to reflect this change in the user entities. user.setEmail(user.getEmail(), false); getMongoStore().updateEntity(user, invocationContext); } } }
verifyEmail = model.isVerifyEmail(); loginWithEmailAllowed = model.isLoginWithEmailAllowed(); duplicateEmailsAllowed = model.isDuplicateEmailsAllowed(); resetPasswordAllowed = model.isResetPasswordAllowed(); identityFederationEnabled = model.isIdentityFederationEnabled();