|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2023 the original author or authors. |
| 2 | + * Copyright 2002-2024 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
16 | 16 |
|
17 | 17 | package org.springframework.security.config.annotation.web.configurers.oauth2.client;
|
18 | 18 |
|
| 19 | +import java.util.function.Function; |
| 20 | + |
19 | 21 | import com.nimbusds.jose.JOSEObjectType;
|
20 | 22 | import com.nimbusds.jose.proc.DefaultJOSEObjectTypeVerifier;
|
21 | 23 | import com.nimbusds.jose.proc.JOSEObjectTypeVerifier;
|
|
31 | 33 | import org.springframework.security.oauth2.core.OAuth2AuthenticationException;
|
32 | 34 | import org.springframework.security.oauth2.core.OAuth2Error;
|
33 | 35 | import org.springframework.security.oauth2.core.OAuth2ErrorCodes;
|
| 36 | +import org.springframework.security.oauth2.core.OAuth2TokenValidator; |
34 | 37 | import org.springframework.security.oauth2.jwt.BadJwtException;
|
35 | 38 | import org.springframework.security.oauth2.jwt.Jwt;
|
36 | 39 | import org.springframework.security.oauth2.jwt.JwtDecoder;
|
37 | 40 | import org.springframework.security.oauth2.jwt.JwtDecoderFactory;
|
| 41 | +import org.springframework.security.oauth2.jwt.JwtValidators; |
38 | 42 | import org.springframework.security.oauth2.jwt.NimbusJwtDecoder;
|
39 | 43 | import org.springframework.util.Assert;
|
40 | 44 | import org.springframework.util.StringUtils;
|
@@ -63,7 +67,8 @@ final class OidcBackChannelLogoutAuthenticationProvider implements Authenticatio
|
63 | 67 | * Construct an {@link OidcBackChannelLogoutAuthenticationProvider}
|
64 | 68 | */
|
65 | 69 | OidcBackChannelLogoutAuthenticationProvider() {
|
66 |
| - DefaultOidcLogoutTokenValidatorFactory jwtValidator = new DefaultOidcLogoutTokenValidatorFactory(); |
| 70 | + Function<ClientRegistration, OAuth2TokenValidator<Jwt>> jwtValidator = (clientRegistration) -> JwtValidators |
| 71 | + .createDefaultWithValidators(new OidcBackChannelLogoutTokenValidator(clientRegistration)); |
67 | 72 | this.logoutTokenDecoderFactory = (clientRegistration) -> {
|
68 | 73 | String jwkSetUri = clientRegistration.getProviderDetails().getJwkSetUri();
|
69 | 74 | if (!StringUtils.hasText(jwkSetUri)) {
|
|
0 commit comments