In our app we would like to lock down the check_token endpoint so that only clients authenticated using client credentials can check the validity of tokens.
The documentation states that an expression handler is enabled by default when @EnableResourceServer
is used, and has some instructions on how to set expression handling up using xml.
What do I need to do do have spring the evaluate the expression below using java config?
@Configuration
@EnableAuthorizationServer
public class OAuth2AuthorizationServerConfiguration extends AuthorizationServerConfigurerAdapter {
...
@Override
public void configure(AuthorizationServerSecurityConfigurer security) throws Exception {
security.checkTokenAccess("#oauth2.isClient()");
}
...
}