@Configuration(proxyBeanMethods=false) @AutoConfigureAfter(value=org.springframework.boot.autoconfigure.security.oauth2.OAuth2AutoConfiguration.class) @ResourceServerTokenRelayAutoConfiguration.ConditionalOnOAuth2ClientInResourceServer @ConditionalOnClass(value=org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfiguration.class) @ConditionalOnWebApplication @ConditionalOnProperty(value="spring.cloud.mvc.token-relay.enabled=true", matchIfMissing=true) public class ResourceServerTokenRelayAutoConfiguration extends Object
@EnableOAuth2Client
and an
OAuth2RestTemplate
. An MVC interceptor is used so as to have a minimal
impact on the call stack. If you are not using MVC you could use a custom filter or AOP
interceptor wrapping the same call to an AccessTokenContextRelay
.
UserInfoTokenServices
generally doesn't need this
interceptor, but it doesn't hurt to include it.Modifier and Type | Class and Description |
---|---|
static class |
ResourceServerTokenRelayAutoConfiguration.ResourceServerTokenRelayRegistrationAutoConfiguration
A
WebMvcConfigurer for the access token interceptor. |
Constructor and Description |
---|
ResourceServerTokenRelayAutoConfiguration() |
Modifier and Type | Method and Description |
---|---|
AccessTokenContextRelay |
accessTokenContextRelay(org.springframework.security.oauth2.client.OAuth2ClientContext context) |
public ResourceServerTokenRelayAutoConfiguration()
@Bean public AccessTokenContextRelay accessTokenContextRelay(org.springframework.security.oauth2.client.OAuth2ClientContext context)
Copyright © 2021 Pivotal Software, Inc.. All rights reserved.