mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-03-01 02:49:11 +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) {
|
||||
@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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user