diff --git a/services/src/main/java/org/keycloak/broker/saml/SAMLEndpoint.java b/services/src/main/java/org/keycloak/broker/saml/SAMLEndpoint.java index d2b21ee5cb..08bbe3e925 100755 --- a/services/src/main/java/org/keycloak/broker/saml/SAMLEndpoint.java +++ b/services/src/main/java/org/keycloak/broker/saml/SAMLEndpoint.java @@ -626,7 +626,7 @@ public class SAMLEndpoint { event.event(EventType.IDENTITY_PROVIDER_RESPONSE); event.detail(Details.REASON, Errors.INVALID_SAML_DOCUMENT); event.error(Errors.INVALID_SAML_RESPONSE); - return ErrorPage.error(session, null, Response.Status.BAD_REQUEST, Messages.INVALID_FEDERATED_IDENTITY_ACTION); + return ErrorPage.error(session, null, Response.Status.BAD_REQUEST, Messages.IDENTITY_PROVIDER_INVALID_RESPONSE); } StatusResponseType statusResponse = (StatusResponseType)holder.getSamlObject(); // validate destination @@ -650,7 +650,7 @@ public class SAMLEndpoint { logger.error("validation failed", e); event.event(EventType.IDENTITY_PROVIDER_RESPONSE); event.error(Errors.INVALID_SIGNATURE); - return ErrorPage.error(session, null, Response.Status.BAD_REQUEST, Messages.INVALID_FEDERATED_IDENTITY_ACTION); + return ErrorPage.error(session, null, Response.Status.BAD_REQUEST, Messages.IDENTITY_PROVIDER_INVALID_SIGNATURE); } } if (statusResponse instanceof ResponseType) { 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 5998b54313..1b32b4b65d 100755 --- a/services/src/main/java/org/keycloak/services/messages/Messages.java +++ b/services/src/main/java/org/keycloak/services/messages/Messages.java @@ -181,6 +181,10 @@ public class Messages { public static final String IDENTITY_PROVIDER_MISSING_STATE_ERROR = "identityProviderMissingStateMessage"; + public static final String IDENTITY_PROVIDER_INVALID_RESPONSE = "identityProviderInvalidResponseMessage"; + + public static final String IDENTITY_PROVIDER_INVALID_SIGNATURE = "identityProviderInvalidSignatureMessage"; + public static final String IDENTITY_PROVIDER_NOT_FOUND = "identityProviderNotFoundMessage"; public static final String IDENTITY_PROVIDER_LINK_SUCCESS = "identityProviderLinkSuccess"; diff --git a/themes/src/main/resources/theme/base/login/messages/messages_en.properties b/themes/src/main/resources/theme/base/login/messages/messages_en.properties index bd60621cb1..a003cc501b 100755 --- a/themes/src/main/resources/theme/base/login/messages/messages_en.properties +++ b/themes/src/main/resources/theme/base/login/messages/messages_en.properties @@ -333,6 +333,8 @@ cookieNotFoundMessage=Cookie not found. Please make sure cookies are enabled in insufficientLevelOfAuthentication=The requested level of authentication has not been satisfied. identityProviderUnexpectedErrorMessage=Unexpected error when authenticating with identity provider identityProviderMissingStateMessage=Missing state parameter in response from identity provider. +identityProviderInvalidResponseMessage=Invalid response from identity provider. +identityProviderInvalidSignatureMessage=Invalid signature in response from identity provider. identityProviderNotFoundMessage=Could not find an identity provider with the identifier. identityProviderLinkSuccess=You successfully verified your email. Please go back to your original browser and continue there with the login. staleCodeMessage=This page is no longer valid, please go back to your application and sign in again