mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-25 13:32:30 +00:00
Merge branch '6.2.x' into 6.3.x
This commit is contained in:
commit
3defed4c3d
@ -861,7 +861,8 @@ public final class OpenSaml4AuthenticationProvider implements AuthenticationProv
|
|||||||
validator) {
|
validator) {
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@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;
|
return ValidationResult.VALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -847,6 +847,20 @@ public class OpenSaml4AuthenticationProviderTests {
|
|||||||
provider.authenticate(token);
|
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) {
|
private <T extends XMLObject> T build(QName qName) {
|
||||||
return (T) XMLObjectProviderRegistrySupport.getBuilderFactory().getBuilder(qName).buildObject(qName);
|
return (T) XMLObjectProviderRegistrySupport.getBuilderFactory().getBuilder(qName).buildObject(qName);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user