diff --git a/services/src/main/java/org/keycloak/authentication/authenticators/x509/X509ClientCertificateAuthenticator.java b/services/src/main/java/org/keycloak/authentication/authenticators/x509/X509ClientCertificateAuthenticator.java index 2a0be0d1a1..688ee07259 100644 --- a/services/src/main/java/org/keycloak/authentication/authenticators/x509/X509ClientCertificateAuthenticator.java +++ b/services/src/main/java/org/keycloak/authentication/authenticators/x509/X509ClientCertificateAuthenticator.java @@ -96,7 +96,7 @@ public class X509ClientCertificateAuthenticator extends AbstractX509ClientCertif String errorMessage = "Certificate validation's failed."; // TODO is calling form().setErrors enough to show errors on login screen? context.challenge(createErrorResponse(context, certs[0].getSubjectDN().getName(), - errorMessage, e.getMessage())); + errorMessage, "Certificate revoked or incorrect.")); context.attempted(); return; } diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/X509BrowserCRLTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/X509BrowserCRLTest.java index a059b6f56f..7b7b58a923 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/X509BrowserCRLTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/X509BrowserCRLTest.java @@ -136,7 +136,7 @@ public class X509BrowserCRLTest extends AbstractX509AuthenticationTest { Assert.assertNotNull(cfgId); // Verify there is an error message because of invalid CRL signature - assertLoginFailedWithExpectedX509Error("Certificate validation's failed.\nSignature length not correct"); + assertLoginFailedWithExpectedX509Error("Certificate validation's failed.\nCertificate revoked or incorrect."); } @@ -194,7 +194,7 @@ public class X509BrowserCRLTest extends AbstractX509AuthenticationTest { private void assertLoginFailedDueRevokedCertificate() { - assertLoginFailedWithExpectedX509Error("Certificate validation's failed.\nCertificate has been revoked, certificate's subject:"); + assertLoginFailedWithExpectedX509Error("Certificate validation's failed.\nCertificate revoked or incorrect."); } private void assertLoginFailedWithExpectedX509Error(String expectedError) { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/X509BrowserLoginTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/X509BrowserLoginTest.java index 05a6ca1376..f909e10664 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/X509BrowserLoginTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/x509/X509BrowserLoginTest.java @@ -106,7 +106,7 @@ public class X509BrowserLoginTest extends AbstractX509AuthenticationTest { loginConfirmationPage.open(); Assert.assertThat(loginPage.getError(), containsString("Certificate validation's failed.\n" + - "Key Usage bit 'dataEncipherment' is not set.")); + "Certificate revoked or incorrect.")); } @Test