77
77
78
78
import static java .nio .charset .StandardCharsets .UTF_8 ;
79
79
import static org .hamcrest .Matchers .containsString ;
80
- import static org .hamcrest .Matchers .equalTo ;
81
80
import static org .hamcrest .Matchers .matchesRegex ;
82
81
import static org .hamcrest .Matchers .startsWith ;
83
82
import static org .springframework .security .saml2 .provider .service .authentication .OpenSamlActionTestingSupport .buildConditions ;
@@ -242,8 +241,8 @@ public void authenticateWhenSignatureKeysDontMatchThenItFails() throws Exception
242
241
sendResponse (response , "/login?error" )
243
242
.andExpect (
244
243
saml2AuthenticationExceptionMatcher (
245
- "invalid_signature " ,
246
- equalTo ( "Assertion doesn't have a valid signature. " )
244
+ "invalid_assertion " ,
245
+ containsString ( "Invalid assertion [assertion] for SAML response " )
247
246
)
248
247
);
249
248
}
@@ -258,7 +257,7 @@ public void authenticateWhenNotOnOrAfterDontMatchThenItFails() throws Exception
258
257
.andExpect (
259
258
saml2AuthenticationExceptionMatcher (
260
259
"invalid_assertion" ,
261
- containsString ("Assertion ' assertion' with NotOnOrAfter condition of " )
260
+ containsString ("Invalid assertion [assertion] for SAML response " )
262
261
)
263
262
);
264
263
}
@@ -273,7 +272,7 @@ public void authenticateWhenNotOnOrBeforeDontMatchThenItFails() throws Exception
273
272
.andExpect (
274
273
saml2AuthenticationExceptionMatcher (
275
274
"invalid_assertion" ,
276
- containsString ("Assertion ' assertion' with NotBefore condition of " )
275
+ containsString ("Invalid assertion [assertion] for SAML response " )
277
276
)
278
277
);
279
278
}
@@ -290,8 +289,7 @@ public void authenticateWhenIssuerIsInvalidThenItFails() throws Exception {
290
289
saml2AuthenticationExceptionMatcher (
291
290
"invalid_issuer" ,
292
291
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"
295
293
)
296
294
)
297
295
);
0 commit comments