Class ResourceServerTokenRelayAutoConfiguration
java.lang.Object
org.springframework.cloud.commons.security.ResourceServerTokenRelayAutoConfiguration
@Configuration(proxyBeanMethods=false)
@ConditionalOnClass(org.springframework.web.servlet.config.annotation.WebMvcConfigurer.class)
@ConditionalOnWebApplication(type=SERVLET)
@ConditionalOnProperty(value="spring.cloud.mvc.token-relay.enabled",
matchIfMissing=true)
public class ResourceServerTokenRelayAutoConfiguration
extends Object
Adds an MVC interceptor for relaying OAuth2 access tokens into the client context (if
there is one). In this way an incoming request to a resource server can be relayed
downstream just be using
N.B. an app that is using
generally doesn't need this
interceptor, but it doesn't hurt to include it.
@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.
N.B. an app that is using
invalid reference
UserInfoTokenServices
- Author:
- Dave Syer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAWebMvcConfigurerfor the access token interceptor. -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ResourceServerTokenRelayAutoConfiguration
public ResourceServerTokenRelayAutoConfiguration()
-