diff --git a/forms/common-themes/src/main/resources/theme/account/base/messages/messages_en.properties b/forms/common-themes/src/main/resources/theme/account/base/messages/messages_en.properties index b5c6f651119..90d927c87d6 100755 --- a/forms/common-themes/src/main/resources/theme/account/base/messages/messages_en.properties +++ b/forms/common-themes/src/main/resources/theme/account/base/messages/messages_en.properties @@ -9,43 +9,45 @@ passwordNew=New Password successHeader=Success! username=Username -missingFirstName=Please specify first name -invalidEmail=Invalid email address -missingLastName=Please specify last name -missingEmail=Please specify email -missingPassword=Please specify password. -notMatchPassword=Passwords don't match +missingFirstNameMessage=Please specify first name. +invalidEmailMessage=Invalid email address. +missingLastNameMessage=Please specify last name. +missingEmailMessage=Please specify email. +missingPasswordMessage=Please specify password. +notMatchPasswordMessage=Passwords don't match. -missingTotp=Please specify authenticator code -invalidPasswordExisting=Invalid existing password -invalidPasswordConfirm=Password confirmation doesn't match -invalidTotp=Invalid authenticator code -readOnlyUser=You can't update your account as it is read only -readOnlyPassword=You can't update your password as your account is read only +missingTotpMessage=Please specify authenticator code +invalidPasswordExistingMessage=Invalid existing password +invalidPasswordConfirmMessage=Password confirmation doesn't match +invalidTotpMessage=Invalid authenticator code -successTotp=Mobile authenticator configured. -successTotpRemoved=Mobile authenticator removed. +readOnlyUserMessage=You can't update your account as it is read only +readOnlyPasswordMessage=You can't update your password as your account is read only -accountUpdated=Your account has been updated -accountPasswordUpdated=Your password has been updated +successTotpMessage=Mobile authenticator configured. +successTotpRemovedMessage=Mobile authenticator removed. -missingIdentityProvider=Identity provider not specified -invalidFederatedIdentityAction=Invalid or missing action -identityProviderNotFound=Specified identity provider not found -federatedIdentityLinkNotActive=This identity is not active anymore -federatedIdentityRemovingLastProvider=You can't remove last federated identity as you don't have password -identityProviderRedirectError=Failed to redirect to identity provider -identityProviderRemoved=Identity provider removed successfully +accountUpdatedMessage=Your account has been updated +accountPasswordUpdatedMessage=Your password has been updated -accountDisabled=Account is disabled, contact admin +missingIdentityProviderMessage=Identity provider not specified +invalidFederatedIdentityActionMessage=Invalid or missing action +identityProviderNotFoundMessage=Specified identity provider not found +federatedIdentityLinkNotActiveMessage=This identity is not active anymore +federatedIdentityRemovingLastProviderMessage=You can't remove last federated identity as you don't have password +identityProviderRedirectErrorMessage=Failed to redirect to identity provider +identityProviderRemovedMessage=Identity provider removed successfully -logOutAllSessions=Log out all sessions -accountTemporarilyDisabled=Account is temporarily disabled, contact admin or try again later -invalidPasswordMinLength=Invalid password\: minimum length {0} -invalidPasswordMinLowerCaseChars=Invalid password\: must contain at least {0} lower case characters -invalidPasswordMinDigits=Invalid password\: must contain at least {0} numerical digits -invalidPasswordMinUpperCaseChars=Invalid password\: must contain at least {0} upper case characters -invalidPasswordMinSpecialChars=Invalid password\: must contain at least {0} special characters +accountDisabledMessage=Account is disabled, contact admin + +doLogOutAllSessions=Log out all sessions + +accountTemporarilyDisabledMessage=Account is temporarily disabled, contact admin or try again later +invalidPasswordMinLengthMessage=Invalid password: minimum length {0} +invalidPasswordMinLowerCaseCharsMessage=Invalid password: must contain at least {0} lower case characters +invalidPasswordMinDigitsMessage=Invalid password: must contain at least {0} numerical digits +invalidPasswordMinUpperCaseCharsMessage=Invalid password: must contain at least {0} upper case characters +invalidPasswordMinSpecialCharsMessage=Invalid password: must contain at least {0} special characters locale_de=German locale_en=English diff --git a/forms/common-themes/src/main/resources/theme/account/base/sessions.ftl b/forms/common-themes/src/main/resources/theme/account/base/sessions.ftl index 85c7a16702e..435f188f98a 100755 --- a/forms/common-themes/src/main/resources/theme/account/base/sessions.ftl +++ b/forms/common-themes/src/main/resources/theme/account/base/sessions.ftl @@ -42,6 +42,6 @@ - ${rb.logOutAllSessions} + ${rb.doLogOutAllSessions} diff --git a/forms/common-themes/src/main/resources/theme/login/base/messages/messages_en.properties b/forms/common-themes/src/main/resources/theme/login/base/messages/messages_en.properties index 4cfbfcad703..7ec9e1e4e14 100755 --- a/forms/common-themes/src/main/resources/theme/login/base/messages/messages_en.properties +++ b/forms/common-themes/src/main/resources/theme/login/base/messages/messages_en.properties @@ -108,30 +108,26 @@ unsupportedNameIdFormatMessage=Unsupported NameIDFormat invlidRequesterMessage=Invalid requester registrationNotAllowedMessage=Registration not allowed +permissionNotApprovedMessage=Permission not approved. +noRelayStateInResponseMessage=No relay state in response from identity provider [{0}]. +identityProviderAlreadyLinkedMessage=The identity returned by the identity provider [{0}] is already linked to another user. +insufficientPermissionMessage=Insufficient permissions to link identities. +couldNotProceedWithAuthenticationRequestMessage=Could not proceed with authentication request to identity provider. +couldNotObtainTokenMessage=Could not obtain token from identity provider [{0}]. +unexpectedErrorRetrievingTokenMessage=Unexpected error when retrieving token from identity provider [{0}]. +unexpectedErrorHandlingResponseMessage=Unexpected error when handling response from identity provider [{0}]. +identityProviderAuthenticationFailedMessage=Authentication failed. Could not authenticate with identity provider [{0}]. +couldNotSendAuthenticationRequestMessage=Could not send authentication request to identity provider [{0}]. +unexpectedErrorHandlingRequestMessage=Unexpected error when handling authentication request to identity provider [{0}]. +invalidAccessCodeMessage=Invalid access code. +sessionNotActiveMessage=Session not active. +unknownCodeMessage=Unknown code, please login again through your application. +invalidCodeMessage=Invalid code, please login again through your application. +identityProviderUnexpectedErrorMessage=Unexpected error when authenticating with identity provider +identityProviderNotFoundMessage=Could not find an identity provider with the identifier [{0}]. +realmSupportsNoCredentialsMessage=Realm [{0}] does not support any credential type. +identityProviderNotUniqueMessage=Realm [{0}] supports multiple identity providers. Could not determine which identity provider should be used to authenticate with. - -permissionNotApproved=Permission not approved. -noRelayStateInResponse=No relay state in response from identity provider [{0}]. -identityProviderAlreadyLinked=The identity returned by the identity provider [{0}] is already linked to another user. -insufficientPermission=Insufficient permissions to link identities. -couldNotProceedWithAuthenticationRequest=Could not proceed with authentication request to identity provider. -couldNotObtainToken=Could not obtain token from identity provider [{0}]. -unexpectedErrorRetrievingToken=Unexpected error when retrieving token from identity provider [{0}]. -unexpectedErrorHandlingResponse=Unexpected error when handling response from identity provider [{0}]. -identityProviderAuthenticationFailed=Authentication failed. Could not authenticate with identity provider [{0}]. -couldNotSendAuthenticationRequest=Could not send authentication request to identity provider [{0}]. -unexpectedErrorHandlingRequest=Unexpected error when handling authentication request to identity provider [{0}]. -invalidAccessCode=Invalid access code. -sessionNotActive=Session not active. -unknownCode=Unknown code, please login again through your application. -invalidCode=Invalid code, please login again through your application. - - -identityProviderUnexpectedError=Unexpected error when authenticating with identity provider -identityProviderNotFound=Could not find an identity provider with the identifier [{0}]. -identityProviderNoToken=Could not obtain token from identity provider [{0}]. -realmSupportsNoCredentials=Realm [{0}] does not support any credential type. -identityProviderNotUnique=Realm [{0}] supports multiple identity providers. Could not determine which identity provider should be used to authenticate with. locale_de=German locale_en=English diff --git a/services/src/main/java/org/keycloak/services/messages/Messages.java b/services/src/main/java/org/keycloak/services/messages/Messages.java index 3384bb2b6ac..71fa449c8fa 100755 --- a/services/src/main/java/org/keycloak/services/messages/Messages.java +++ b/services/src/main/java/org/keycloak/services/messages/Messages.java @@ -114,62 +114,65 @@ public class Messages { - public static final String PERMISSION_NOT_APPROVED = "permissionNotApproved"; + public static final String PERMISSION_NOT_APPROVED = "permissionNotApprovedMessage"; - public static final String NO_RELAY_STATE_IN_RESPONSE = "noRelayStateInResponse"; + public static final String NO_RELAY_STATE_IN_RESPONSE = "noRelayStateInResponseMessage"; - public static final String IDENTITY_PROVIDER_ALREADY_LINKED = "identityProviderAlreadyLinked"; + public static final String IDENTITY_PROVIDER_ALREADY_LINKED = "identityProviderAlreadyLinkedMessage"; - public static final String INSUFFICIENT_PERMISSION = "insufficientPermission"; + public static final String INSUFFICIENT_PERMISSION = "insufficientPermissionMessage"; - public static final String COULD_NOT_PROCEED_WITH_AUTHENTICATION_REQUEST = "couldNotProceedWithAuthenticationRequest"; + public static final String COULD_NOT_PROCEED_WITH_AUTHENTICATION_REQUEST = "couldNotProceedWithAuthenticationRequestMessage"; - public static final String COULD_NOT_OBTAIN_TOKEN = "couldNotObtainToken"; + public static final String COULD_NOT_OBTAIN_TOKEN = "couldNotObtainTokenMessage"; - public static final String UNEXPECTED_ERROR_RETRIEVING_TOKEN = "unexpectedErrorRetrievingToken"; + public static final String UNEXPECTED_ERROR_RETRIEVING_TOKEN = "unexpectedErrorRetrievingTokenMessage"; - public static final String IDENTITY_PROVIDER_AUTHENTICATION_FAILED = "identityProviderAuthenticationFailed"; + public static final String IDENTITY_PROVIDER_AUTHENTICATION_FAILED = "identityProviderAuthenticationFailedMessage"; - public static final String UNEXPECTED_ERROR_HANDLING_RESPONSE = "unexpectedErrorHandlingResponse"; + public static final String UNEXPECTED_ERROR_HANDLING_RESPONSE = "unexpectedErrorHandlingResponseMessage"; - public static final String COULD_NOT_SEND_AUTHENTICATION_REQUEST = "couldNotSendAuthenticationRequest"; + public static final String COULD_NOT_SEND_AUTHENTICATION_REQUEST = "couldNotSendAuthenticationRequestMessage"; - public static final String UNEXPECTED_ERROR_HANDLING_REQUEST = "unexpectedErrorHandlingRequest"; + public static final String UNEXPECTED_ERROR_HANDLING_REQUEST = "unexpectedErrorHandlingRequestMessage"; - public static final String INVALID_ACCESS_CODE = "invalidAccessCode"; + public static final String INVALID_ACCESS_CODE = "invalidAccessCodeMessage"; - public static final String SESSION_NOT_ACTIVE = "sessionNotActive"; + public static final String SESSION_NOT_ACTIVE = "sessionNotActiveMessage"; - public static final String UNKNOWN_CODE = "unknownCode"; + public static final String UNKNOWN_CODE = "unknownCodeMessage"; - public static final String INVALID_CODE = "invalidCode"; + public static final String INVALID_CODE = "invalidCodeMessage"; - public static final String IDENTITY_PROVIDER_UNEXPECTED_ERROR = "identityProviderUnexpectedError"; + public static final String IDENTITY_PROVIDER_UNEXPECTED_ERROR = "identityProviderUnexpectedErrorMessage"; - public static final String IDENTITY_PROVIDER_NOT_FOUND = "identityProviderNotFound"; + public static final String IDENTITY_PROVIDER_NOT_FOUND = "identityProviderNotFoundMessage"; + public static final String IDENTITY_PROVIDER_NOT_UNIQUE = "identityProviderNotUniqueMessage"; - public static final String READ_ONLY_USER = "readOnlyUser"; + public static final String REALM_SUPPORTS_NO_CREDENTIALS = "realmSupportsNoCredentialsMessage"; - public static final String READ_ONLY_PASSWORD = "readOnlyPassword"; + public static final String READ_ONLY_USER = "readOnlyUserMessage"; - public static final String MISSING_IDENTITY_PROVIDER = "missingIdentityProvider"; + public static final String READ_ONLY_PASSWORD = "readOnlyPasswordMessage"; - public static final String INVALID_FEDERATED_IDENTITY_ACTION = "invalidFederatedIdentityAction"; + public static final String SUCCESS_TOTP_REMOVED = "successTotpRemovedMessage"; - public static final String FEDERATED_IDENTITY_NOT_ACTIVE = "federatedIdentityLinkNotActive"; + public static final String SUCCESS_TOTP = "successTotpMessage"; - public static final String FEDERATED_IDENTITY_REMOVING_LAST_PROVIDER = "federatedIdentityRemovingLastProvider"; + public static final String MISSING_IDENTITY_PROVIDER = "missingIdentityProviderMessage"; - public static final String IDENTITY_PROVIDER_REDIRECT_ERROR = "identityProviderRedirectError"; + public static final String INVALID_FEDERATED_IDENTITY_ACTION = "invalidFederatedIdentityActionMessage"; - public static final String IDENTITY_PROVIDER_REMOVED = "identityProviderRemoved"; + public static final String FEDERATED_IDENTITY_NOT_ACTIVE = "federatedIdentityLinkNotActiveMessage"; + + public static final String FEDERATED_IDENTITY_REMOVING_LAST_PROVIDER = "federatedIdentityRemovingLastProviderMessage"; + + public static final String IDENTITY_PROVIDER_REDIRECT_ERROR = "identityProviderRedirectErrorMessage"; + + public static final String IDENTITY_PROVIDER_REMOVED = "identityProviderRemovedMessage"; - public static final String IDENTITY_PROVIDER_NO_TOKEN = "identityProviderNoToken"; public static final String ERROR = "error"; - public static final String REALM_SUPPORTS_NO_CREDENTIALS = "realmSupportsNoCredentials"; - - public static final String IDENTITY_PROVIDER_NOT_UNIQUE = "identityProviderNotUnique"; } diff --git a/services/src/main/java/org/keycloak/services/resources/AccountService.java b/services/src/main/java/org/keycloak/services/resources/AccountService.java index 861c9156f38..2127e422928 100755 --- a/services/src/main/java/org/keycloak/services/resources/AccountService.java +++ b/services/src/main/java/org/keycloak/services/resources/AccountService.java @@ -450,7 +450,7 @@ public class AccountService { event.event(EventType.REMOVE_TOTP).client(auth.getClient()).user(auth.getUser()).success(); setReferrerOnPage(); - return account.setSuccess("successTotpRemoved").createResponse(AccountPages.TOTP); + return account.setSuccess(Messages.SUCCESS_TOTP_REMOVED).createResponse(AccountPages.TOTP); } @@ -529,7 +529,7 @@ public class AccountService { event.event(EventType.UPDATE_TOTP).client(auth.getClient()).user(auth.getUser()).success(); setReferrerOnPage(); - return account.setSuccess("successTotp").createResponse(AccountPages.TOTP); + return account.setSuccess(Messages.SUCCESS_TOTP).createResponse(AccountPages.TOTP); } /**