|
|
|
@ -35,8 +35,8 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
|
|
|
|
|
import org.springframework.security.oauth2.client.registration.ClientRegistration;
|
|
|
|
|
import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository;
|
|
|
|
|
import org.springframework.security.oauth2.client.registration.InMemoryClientRegistrationRepository;
|
|
|
|
|
import org.springframework.security.oauth2.client.web.AuthorizationCodeAuthenticationFilter;
|
|
|
|
|
import org.springframework.security.oauth2.client.web.AuthorizationRequestRedirectFilter;
|
|
|
|
|
import org.springframework.security.oauth2.client.web.OAuth2LoginAuthenticationFilter;
|
|
|
|
|
import org.springframework.security.oauth2.core.AuthorizationGrantType;
|
|
|
|
|
import org.springframework.security.web.FilterChainProxy;
|
|
|
|
|
import org.springframework.security.web.SecurityFilterChain;
|
|
|
|
@ -96,11 +96,11 @@ public class OAuth2WebSecurityConfigurationTests {
|
|
|
|
|
List<Filter> filters = (List<Filter>) ReflectionTestUtils
|
|
|
|
|
.getField(filterChains.get(0), "filters");
|
|
|
|
|
List<Filter> oauth2Filters = filters.stream()
|
|
|
|
|
.filter((f) -> f instanceof AuthorizationCodeAuthenticationFilter
|
|
|
|
|
.filter((f) -> f instanceof OAuth2LoginAuthenticationFilter
|
|
|
|
|
|| f instanceof AuthorizationRequestRedirectFilter)
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
return oauth2Filters.stream()
|
|
|
|
|
.filter((f) -> f instanceof AuthorizationCodeAuthenticationFilter)
|
|
|
|
|
.filter((f) -> f instanceof OAuth2LoginAuthenticationFilter)
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|