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 .startsWith ;
82
81
import static org .springframework .security .samples .OpenSamlActionTestingSupport .buildConditions ;
83
82
import static org .springframework .security .samples .OpenSamlActionTestingSupport .buildIssuer ;
@@ -237,8 +236,8 @@ public void authenticateWhenSignatureKeysDontMatchThenItFails() throws Exception
237
236
sendResponse (response , "/login?error" )
238
237
.andExpect (
239
238
saml2AuthenticationExceptionMatcher (
240
- "invalid_signature " ,
241
- equalTo ( "Assertion doesn't have a valid signature. " )
239
+ "invalid_assertion " ,
240
+ containsString ( "Invalid assertion [assertion] for SAML response " )
242
241
)
243
242
);
244
243
}
@@ -253,7 +252,7 @@ public void authenticateWhenNotOnOrAfterDontMatchThenItFails() throws Exception
253
252
.andExpect (
254
253
saml2AuthenticationExceptionMatcher (
255
254
"invalid_assertion" ,
256
- containsString ("Assertion ' assertion' with NotOnOrAfter condition of " )
255
+ containsString ("Invalid assertion [assertion] for SAML response " )
257
256
)
258
257
);
259
258
}
@@ -268,7 +267,7 @@ public void authenticateWhenNotOnOrBeforeDontMatchThenItFails() throws Exception
268
267
.andExpect (
269
268
saml2AuthenticationExceptionMatcher (
270
269
"invalid_assertion" ,
271
- containsString ("Assertion ' assertion' with NotBefore condition of " )
270
+ containsString ("Invalid assertion [assertion] for SAML response " )
272
271
)
273
272
);
274
273
}
@@ -285,8 +284,7 @@ public void authenticateWhenIssuerIsInvalidThenItFails() throws Exception {
285
284
saml2AuthenticationExceptionMatcher (
286
285
"invalid_issuer" ,
287
286
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"
290
288
)
291
289
)
292
290
);
0 commit comments