2121import org .opensaml .saml .saml2 .core .Audience ;
2222import org .opensaml .saml .saml2 .core .AuthnRequest ;
2323import org .opensaml .saml .saml2 .core .Conditions ;
24- import org .opensaml .saml .saml2 .core .EncryptedAssertion ;
2524import org .opensaml .saml .saml2 .core .EncryptedAttribute ;
2625import org .opensaml .saml .saml2 .core .Response ;
2726import org .opensaml .saml .saml2 .core .SubjectConfirmation ;
@@ -179,7 +178,7 @@ void authenticateWhenAssertionContainsValidationAddressThenItSucceeds() {
179178 Assertion assertion = assertion ();
180179 assertion .getSubject ()
181180 .getSubjectConfirmations ()
182- .forEach (( sc ) -> sc .getSubjectConfirmationData ().setAddress ("10.10.10.10" ));
181+ .forEach (sc -> sc .getSubjectConfirmationData ().setAddress ("10.10.10.10" ));
183182 Saml2AuthenticationToken token = token (assertion , verifying (registration ()));
184183 this .provider .authenticate (token );
185184 }
@@ -204,15 +203,6 @@ void evaluateInResponseToFailsWhenInResponseToInAssertionMismatchWithRequestID()
204203 .withStackTraceContaining ("invalid_assertion" );
205204 }
206205
207- @ Test
208- void evaluateInResponseToSucceedsWhenNoInResponseToInResponseOrAssertions () {
209- Assertion assertion = assertion ();
210- AbstractSaml2AuthenticationRequest mockAuthenticationRequest = mockedStoredAuthenticationRequest ("SAML2" ,
211- Saml2MessageBinding .POST , false );
212- Saml2AuthenticationToken token = token (assertion , verifying (registration ()), mockAuthenticationRequest );
213- this .provider .authenticate (token );
214- }
215-
216206 @ Test
217207 void authenticateWhenAssertionContainsAttributesThenItSucceeds () {
218208 Assertion assertion = assertion ();
@@ -364,8 +354,6 @@ void authenticateWhenAuthenticationHasDetailsThenSucceeds() {
364354 void writeObjectWhenTypeIsSaml2AuthenticationThenNoException () throws IOException {
365355 Assertion assertion = TestOpenSamlObjects .signed (assertion (),
366356 TestSaml2X509Credentials .assertingPartySigningCredential (), RELYING_PARTY_ENTITY_ID );
367- EncryptedAssertion encryptedAssertion = TestOpenSamlObjects .encrypted (assertion ,
368- TestSaml2X509Credentials .assertingPartyEncryptingCredential ());
369357 Saml2AuthenticationToken token = token (signed (assertion ), decrypting (verifying (registration ())));
370358 Saml2Authentication authentication = (Saml2Authentication ) this .provider .authenticate (token );
371359 // the following code will throw an exception if authentication isn't serializable
@@ -412,7 +400,7 @@ void authenticateWhenAssertionIssuerNotValidThenFailsWithInvalidIssuer() {
412400 assertion .setIssuer (TestOpenSamlObjects .issuer ("https://invalid.idp.test/saml2/idp" ));
413401 Saml2AuthenticationToken token = token (signed (assertion ), verifying (registration ()));
414402 assertThatExceptionOfType (Saml2AuthenticationException .class ).isThrownBy (() -> provider .authenticate (token ))
415- .withMessageContaining ("from Issuer" ,"was not valid" );
403+ .withMessageContaining ("from Issuer" , "was not valid" );
416404 }
417405
418406 private <T extends XMLObject > T build (QName qName ) {
@@ -449,8 +437,7 @@ private Response response() {
449437 }
450438
451439 private AuthnRequest request () {
452- AuthnRequest request = TestOpenSamlObjects .authnRequest ();
453- return request ;
440+ return TestOpenSamlObjects .authnRequest ();
454441 }
455442
456443 private String serializedRequest (AuthnRequest request , Saml2MessageBinding binding ) {
@@ -515,10 +502,6 @@ private Saml2AuthenticationToken token(Assertion assertion, RelyingPartyRegistra
515502 return new Saml2AuthenticationToken (registration .build (), serialize (assertion ));
516503 }
517504
518- private Saml2AuthenticationToken token (EncryptedAssertion assertion , RelyingPartyRegistration .Builder registration ) {
519- return new Saml2AuthenticationToken (registration .build (), serialize (assertion ));
520- }
521-
522505 private Saml2AuthenticationToken token (Assertion assertion , RelyingPartyRegistration .Builder registration ,
523506 AbstractSaml2AuthenticationRequest authenticationRequest ) {
524507 return new Saml2AuthenticationToken (registration .build (), serialize (assertion ), authenticationRequest );
0 commit comments