Skip to content

Commit 1fcac58

Browse files
committed
Update SAML2 errors in integration tests
1 parent fd39071 commit 1fcac58

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

samples/boot/saml2login/src/integration-test/java/org/springframework/security/saml2/provider/service/authentication/Saml2LoginIntegrationTests.java

+5-7
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@
7777

7878
import static java.nio.charset.StandardCharsets.UTF_8;
7979
import static org.hamcrest.Matchers.containsString;
80-
import static org.hamcrest.Matchers.equalTo;
8180
import static org.hamcrest.Matchers.matchesRegex;
8281
import static org.hamcrest.Matchers.startsWith;
8382
import static org.springframework.security.saml2.provider.service.authentication.OpenSamlActionTestingSupport.buildConditions;
@@ -242,8 +241,8 @@ public void authenticateWhenSignatureKeysDontMatchThenItFails() throws Exception
242241
sendResponse(response, "/login?error")
243242
.andExpect(
244243
saml2AuthenticationExceptionMatcher(
245-
"invalid_signature",
246-
equalTo("Assertion doesn't have a valid signature.")
244+
"invalid_assertion",
245+
containsString("Invalid assertion [assertion] for SAML response")
247246
)
248247
);
249248
}
@@ -258,7 +257,7 @@ public void authenticateWhenNotOnOrAfterDontMatchThenItFails() throws Exception
258257
.andExpect(
259258
saml2AuthenticationExceptionMatcher(
260259
"invalid_assertion",
261-
containsString("Assertion 'assertion' with NotOnOrAfter condition of")
260+
containsString("Invalid assertion [assertion] for SAML response")
262261
)
263262
);
264263
}
@@ -273,7 +272,7 @@ public void authenticateWhenNotOnOrBeforeDontMatchThenItFails() throws Exception
273272
.andExpect(
274273
saml2AuthenticationExceptionMatcher(
275274
"invalid_assertion",
276-
containsString("Assertion 'assertion' with NotBefore condition of")
275+
containsString("Invalid assertion [assertion] for SAML response")
277276
)
278277
);
279278
}
@@ -290,8 +289,7 @@ public void authenticateWhenIssuerIsInvalidThenItFails() throws Exception {
290289
saml2AuthenticationExceptionMatcher(
291290
"invalid_issuer",
292291
containsString(
293-
"Response issuer 'invalid issuer' doesn't match "+
294-
"'https://simplesaml-for-spring-saml.cfapps.io/saml2/idp/metadata.php'"
292+
"Invalid issuer [invalid issuer] for SAML response"
295293
)
296294
)
297295
);

0 commit comments

Comments
 (0)