【发布时间】:2015-11-27 07:13:49
【问题描述】:
我正在尝试使用 Spring Boot 创建仅支持客户端凭据流的 oauth2 授权。据我了解,客户端直接访问 /oauth/token 端点。有没有办法在 Spring Boot 中禁用 /oauth/authorize 端点并允许直接访问 /oauth/token 而无需先获得完全授权?
@Configuration
@EnableAuthorizationServer
public class OAuth2Configuration extends AuthorizationServerConfigurerAdapter {
@Autowired
private AuthenticationManager authenticationManager;
@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
// TODO: Is there something I can do here to disable /oauth/authorize?
endpoints.authenticationManager(authenticationManager);
}
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
// client details configuration
}
}
【问题讨论】:
标签: java spring oauth spring-security spring-boot