Merge branch '6.3.x'

This commit is contained in:
Josh Cummings 2024-05-31 14:14:02 -06:00
commit b73155df26
No known key found for this signature in database
GPG Key ID: A306A51F43B8E5A5
2 changed files with 16 additions and 1 deletions

View File

@ -861,7 +861,8 @@ public final class OpenSaml4AuthenticationProvider implements AuthenticationProv
validator) {
@Nonnull
@Override
protected ValidationResult validateBasicData(@Nonnull Assertion assertion, @Nonnull ValidationContext context) throws AssertionValidationException {
protected ValidationResult validateBasicData(@Nonnull Assertion assertion,
@Nonnull ValidationContext context) throws AssertionValidationException {
return ValidationResult.VALID;
}

View File

@ -847,6 +847,20 @@ public class OpenSaml4AuthenticationProviderTests {
provider.authenticate(token);
}
// gh-15022
@Test
public void authenticateWhenClockSkewThenVerifiesSignature() {
OpenSaml4AuthenticationProvider provider = new OpenSaml4AuthenticationProvider();
provider.setAssertionValidator(OpenSaml4AuthenticationProvider.createDefaultAssertionValidatorWithParameters(
(params) -> params.put(SAML2AssertionValidationParameters.CLOCK_SKEW, Duration.ofMinutes(10))));
Response response = response();
Assertion assertion = assertion();
assertion.setIssueInstant(Instant.now().plus(Duration.ofMinutes(9)));
response.getAssertions().add(assertion);
Saml2AuthenticationToken token = token(signed(response), verifying(registration()));
provider.authenticate(token);
}
private <T extends XMLObject> T build(QName qName) {
return (T) XMLObjectProviderRegistrySupport.getBuilderFactory().getBuilder(qName).buildObject(qName);
}