Skip to content

Commit 3ed3140

Browse files
committed
Update SAML2 errors in integration tests
1 parent 69b1bc6 commit 3ed3140

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/samples/Saml2LoginIntegrationTests.java

Lines changed: 5 additions & 7 deletions
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.startsWith;
8281
import static org.springframework.security.samples.OpenSamlActionTestingSupport.buildConditions;
8382
import static org.springframework.security.samples.OpenSamlActionTestingSupport.buildIssuer;
@@ -237,8 +236,8 @@ public void authenticateWhenSignatureKeysDontMatchThenItFails() throws Exception
237236
sendResponse(response, "/login?error")
238237
.andExpect(
239238
saml2AuthenticationExceptionMatcher(
240-
"invalid_signature",
241-
equalTo("Assertion doesn't have a valid signature.")
239+
"invalid_assertion",
240+
containsString("Invalid assertion [assertion] for SAML response")
242241
)
243242
);
244243
}
@@ -253,7 +252,7 @@ public void authenticateWhenNotOnOrAfterDontMatchThenItFails() throws Exception
253252
.andExpect(
254253
saml2AuthenticationExceptionMatcher(
255254
"invalid_assertion",
256-
containsString("Assertion 'assertion' with NotOnOrAfter condition of")
255+
containsString("Invalid assertion [assertion] for SAML response")
257256
)
258257
);
259258
}
@@ -268,7 +267,7 @@ public void authenticateWhenNotOnOrBeforeDontMatchThenItFails() throws Exception
268267
.andExpect(
269268
saml2AuthenticationExceptionMatcher(
270269
"invalid_assertion",
271-
containsString("Assertion 'assertion' with NotBefore condition of")
270+
containsString("Invalid assertion [assertion] for SAML response")
272271
)
273272
);
274273
}
@@ -285,8 +284,7 @@ public void authenticateWhenIssuerIsInvalidThenItFails() throws Exception {
285284
saml2AuthenticationExceptionMatcher(
286285
"invalid_issuer",
287286
containsString(
288-
"Response issuer 'invalid issuer' doesn't match "+
289-
"'https://simplesaml-for-spring-saml.cfapps.io/saml2/idp/metadata.php'"
287+
"Invalid issuer [invalid issuer] for SAML response"
290288
)
291289
)
292290
);

0 commit comments

Comments
 (0)