diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy).launch b/java/com.sap.sailing.server/SailingServer (No Proxy).launch index 62a36254207..2dc59f9d6f5 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy).launch @@ -24,7 +24,7 @@ - + diff --git a/java/com.sap.sse.security.common/src/com/sap/sse/security/shared/UserManagementException.java b/java/com.sap.sse.security.common/src/com/sap/sse/security/shared/UserManagementException.java index d514e33a588..53b669fc563 100644 --- a/java/com.sap.sse.security.common/src/com/sap/sse/security/shared/UserManagementException.java +++ b/java/com.sap.sse.security.common/src/com/sap/sse/security/shared/UserManagementException.java @@ -14,6 +14,8 @@ public class UserManagementException extends UserStoreManagementException implem public static final String USERNAME_DOES_NOT_MEET_REQUIREMENTS = "Username does not meet requirements"; public static final String CANNOT_RESET_PASSWORD_WITHOUT_VALIDATED_EMAIL = "Cannot reset password without validated e-mail address"; public static final String USER_DOESNT_HAVE_PERMISSION = "The user does not have the required permission"; + public static final String CLIENT_CURRENTLY_LOCKED_FOR_USER_CREATION = "Client currently locked for user creation"; + public static final String PASSWORD_AUTHENTICATION_CURRENTLY_LOCKED_FOR_USER = "Password authentication currently locked for user"; private final String message; diff --git a/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/authentication/AuthenticationManagerImpl.java b/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/authentication/AuthenticationManagerImpl.java index 587dfbce104..579b8aad6be 100755 --- a/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/authentication/AuthenticationManagerImpl.java +++ b/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/authentication/AuthenticationManagerImpl.java @@ -127,6 +127,8 @@ public class AuthenticationManagerImpl implements AuthenticationManager { if (caught instanceof UserManagementException) { if (Util.hasLength(caught.getMessage()) && caught.getMessage().equals(USER_ALREADY_EXISTS)) { view.setErrorMessage(i18n.userAlreadyExists(name)); + } else if (Util.hasLength(caught.getMessage()) && caught.getMessage().equals(UserManagementException.CLIENT_CURRENTLY_LOCKED_FOR_USER_CREATION)) { + view.setErrorMessage(i18n.clientCurrentlyLockedForUserCreation()); } else { Notification.notify(i18n.errorCreatingUser(name, caught.getMessage()==null?"":caught.getMessage()), NotificationType.ERROR); } diff --git a/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/client/i18n/StringMessages.java b/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/client/i18n/StringMessages.java index 289bbb9c203..48f52cf123a 100755 --- a/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/client/i18n/StringMessages.java +++ b/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/client/i18n/StringMessages.java @@ -224,4 +224,6 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages { String paymentUnfinished(); String paymentFinished(); String lockedUntil(); + String passwordAuthenticationCurrentlyLockedForUser(); + String clientCurrentlyLockedForUserCreation(); } diff --git a/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/client/i18n/StringMessages.properties b/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/client/i18n/StringMessages.properties index 84ffbd286ec..5fcdfea2169 100644 --- a/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/client/i18n/StringMessages.properties +++ b/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/client/i18n/StringMessages.properties @@ -230,4 +230,6 @@ takeMeToSubscriptions=Go to subscription plans errorPollingCheckoutResults=Could not retrieve payment status. paymentUnfinished=Waiting for payment to process. paymentFinished=Payment successful. Plan roles have been granted. -lockedUntil=Locked until \ No newline at end of file +lockedUntil=Locked until +passwordAuthenticationCurrentlyLockedForUser=Password authentication is currently locked for this user due to too many failed login attempts. Please try again later. +clientCurrentlyLockedForUserCreation=Client is currently locked for user creation after too many user creations by the same client. Please try again later. \ No newline at end of file diff --git a/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/client/i18n/StringMessages_de.properties b/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/client/i18n/StringMessages_de.properties index 2a218b99347..b0da9ee230a 100644 --- a/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/client/i18n/StringMessages_de.properties +++ b/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/client/i18n/StringMessages_de.properties @@ -226,4 +226,6 @@ takeMeToSubscriptions=Zur Abbonementübersicht errorPollingCheckoutResults=Der Zahlungsstatus konnte nicht abgerufen werden. paymentUnfinished=Warte auf Zahlungsbestätigung. paymentFinished=Zahlung erfolgreich. Planrollen wurden verliehen. -lockedUntil=Gesperrt bis \ No newline at end of file +lockedUntil=Gesperrt bis +passwordAuthenticationCurrentlyLockedForUser=Passwort-Authentifizierung ist für diesen Benutzer derzeit aufgrund zu vieler fehlgeschlagener Versuche gesperrt. Bitter später erneut versuchen. +clientCurrentlyLockedForUserCreation=Benutzererstellung für den aktuellen Client ist derzeit wegen zu vieler neuer Nutzer vom selben Client gesperrt. Bitte später erneut versuchen. \ No newline at end of file diff --git a/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/editprofile/EditProfileEntryPoint.java b/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/editprofile/EditProfileEntryPoint.java index 30ad860fe9b..a3e17dba3e5 100755 --- a/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/editprofile/EditProfileEntryPoint.java +++ b/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/editprofile/EditProfileEntryPoint.java @@ -179,6 +179,8 @@ public class EditProfileEntryPoint implements EntryPoint { Notification.notify(stringMessages.passwordDoesNotMeetRequirements(), NotificationType.ERROR); } else if (UserManagementException.INVALID_CREDENTIALS.equals(message)) { Notification.notify(stringMessages.invalidCredentials(), NotificationType.ERROR); + } else if (UserManagementException.PASSWORD_AUTHENTICATION_CURRENTLY_LOCKED_FOR_USER.equals(message)) { + Notification.notify(stringMessages.passwordAuthenticationCurrentlyLockedForUser(), NotificationType.ERROR); } else { Notification.notify(stringMessages.errorChangingPassword(caught.getMessage()), NotificationType.ERROR); } diff --git a/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/registration/RegisterView.java b/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/registration/RegisterView.java index bd14a1c9894..a5a1618bc01 100755 --- a/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/registration/RegisterView.java +++ b/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/registration/RegisterView.java @@ -94,29 +94,32 @@ public class RegisterView extends Composite { /* fullName */ null, /* company */ null, LocaleInfo.getCurrentLocale().getLocaleName(), EntryPointLinkFactory.createEmailValidationLink(new HashMap()), new AsyncCallback() { - @Override - public void onFailure(Throwable caught) { - final String message = caught.getMessage(); - if (caught instanceof UserManagementException) { - if (Util.hasLength(message) && message.equals(USER_ALREADY_EXISTS)) { - Notification.notify(stringMessages.userAlreadyExists(usernameTextBox.getText()), NotificationType.ERROR); - } else { - Notification.notify(stringMessages.errorCreatingUser(usernameTextBox.getText(), message==null?"":message), NotificationType.ERROR); + @Override + public void onFailure(Throwable caught) { + final String message = caught.getMessage(); + if (caught instanceof UserManagementException) { + if (Util.hasLength(message) && message.equals(USER_ALREADY_EXISTS)) { + Notification.notify(stringMessages.userAlreadyExists(usernameTextBox.getText()), NotificationType.ERROR); + } else if (Util.hasLength(message) && message.equals(UserManagementException.CLIENT_CURRENTLY_LOCKED_FOR_USER_CREATION)) { + Notification.notify(stringMessages.clientCurrentlyLockedForUserCreation(), NotificationType.ERROR); + } else { + Notification.notify(stringMessages.errorCreatingUser(usernameTextBox.getText(), + message == null ? "" : message), NotificationType.ERROR); + } + } else { + Notification.notify(stringMessages.errorCreatingUser(usernameTextBox.getText(), message), NotificationType.ERROR); + } + } + + @Override + public void onSuccess(UserDTO result) { + if (result != null) { + Notification.notify(stringMessages.signedUpSuccessfully(result.getName()), NotificationType.SUCCESS); + closeWindow(); + } else { + Notification.notify(stringMessages.unknownErrorCreatingUser(usernameTextBox.getText()), NotificationType.ERROR); + } } - } else { - Notification.notify(stringMessages.errorCreatingUser(usernameTextBox.getText(), message), NotificationType.ERROR); - } - } - - @Override - public void onSuccess(UserDTO result) { - if (result != null) { - Notification.notify(stringMessages.signedUpSuccessfully(result.getName()), NotificationType.SUCCESS); - closeWindow(); - } else { - Notification.notify(stringMessages.unknownErrorCreatingUser(usernameTextBox.getText()), NotificationType.ERROR); - } - } }); } diff --git a/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/userprofile/shared/userdetails/UserDetailsPresenter.java b/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/userprofile/shared/userdetails/UserDetailsPresenter.java index e49a84cef10..ece459e81a2 100755 --- a/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/userprofile/shared/userdetails/UserDetailsPresenter.java +++ b/java/com.sap.sse.security.ui/src/main/java/com/sap/sse/security/ui/userprofile/shared/userdetails/UserDetailsPresenter.java @@ -103,6 +103,8 @@ public class UserDetailsPresenter implements AbstractUserDetails.Presenter { Notification.notify(i18n_sec.passwordDoesNotMeetRequirements(), NotificationType.ERROR); } else if (UserManagementException.INVALID_CREDENTIALS.equals(message)) { Notification.notify(i18n_sec.invalidCredentials(), NotificationType.ERROR); + } else if (UserManagementException.PASSWORD_AUTHENTICATION_CURRENTLY_LOCKED_FOR_USER.equals(message)) { + Notification.notify(i18n_sec.passwordAuthenticationCurrentlyLockedForUser(), NotificationType.ERROR); } else { Notification.notify(i18n_sec.errorChangingPassword(caught.getMessage()), NotificationType.ERROR); } diff --git a/java/com.sap.sse.security/src/com/sap/sse/security/impl/SecurityServiceImpl.java b/java/com.sap.sse.security/src/com/sap/sse/security/impl/SecurityServiceImpl.java index 59e2c47cc92..5a01ad578a3 100755 --- a/java/com.sap.sse.security/src/com/sap/sse/security/impl/SecurityServiceImpl.java +++ b/java/com.sap.sse.security/src/com/sap/sse/security/impl/SecurityServiceImpl.java @@ -1152,7 +1152,7 @@ implements ReplicableSecurityService, ClearStateTestSupport { if (lockingAndBanning == null || !lockingAndBanning.isAuthenticationLocked()) { apply(s->s.internalRecordUserCreationFromClientIP(clientIP)); } else { - throw new UserManagementException("Client IP "+clientIP+" locked for user creation: "+lockingAndBanning); + throw new UserManagementException(UserManagementException.CLIENT_CURRENTLY_LOCKED_FOR_USER_CREATION); } } } @@ -1267,7 +1267,7 @@ implements ReplicableSecurityService, ClearStateTestSupport { throw new UserManagementException(UserManagementException.USER_DOES_NOT_EXIST); } if (user.getLockingAndBanning().isAuthenticationLocked()) { - throw new UserManagementException("Password authentication is locked for user "+username); + throw new UserManagementException(UserManagementException.PASSWORD_AUTHENTICATION_CURRENTLY_LOCKED_FOR_USER); } final UsernamePasswordAccount account = (UsernamePasswordAccount) user.getAccount(AccountType.USERNAME_PASSWORD); String hashedOldPassword = hashPassword(password, account.getSalt());