Skip to content

Commit 868342b

Browse files
committed
Add OpenSAML 5 Test
Issue gh-17008
1 parent ce000ed commit 868342b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

saml2/saml2-service-provider/src/opensaml5Test/java/org/springframework/security/saml2/provider/service/authentication/OpenSaml5AuthenticationProviderTests.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,15 @@ public void authenticateWhenClockSkewThenVerifiesSignature() {
889889
provider.authenticate(token);
890890
}
891891

892+
// gh-16989
893+
@Test
894+
public void authenticateWhenNullIssuerThenNoNullPointer() {
895+
OpenSaml5AuthenticationProvider provider = new OpenSaml5AuthenticationProvider();
896+
Response response = TestOpenSamlObjects.signedResponseWithOneAssertion((r) -> r.setIssuer(null));
897+
Saml2AuthenticationToken token = token(response, verifying(registration()));
898+
assertThatExceptionOfType(Saml2AuthenticationException.class).isThrownBy(() -> provider.authenticate(token));
899+
}
900+
892901
private <T extends XMLObject> T build(QName qName) {
893902
return (T) XMLObjectProviderRegistrySupport.getBuilderFactory().getBuilder(qName).buildObject(qName);
894903
}

0 commit comments

Comments
 (0)