0

首先,我已经完成了关于这个主题的前面的问题。

我正在尝试自定义 org.springframework.security.oauth2.provider.endpoint.TokenEndpoint 和 CheckTokenEndpoint 的实现。我可以轻松做到这一点,但我不知道如何在 Spring Oauth2 Architecture 中插入该自定义实现。我在我的应用程序中使用 @EnableAuthorizationServer 注释。有人可以解释一下吗?

4

1 回答 1

2

查看 AuthorizationServerEndpointsConfiguration 类。端点有@Bean 定义。尝试使用相同的名称注册您的端点定义bean并将它们注册为@Primary @Bean

IE

@Primary
@Bean
public CustomTokenEndpoint tokenEndpoint() throws Exception {
...
}
于 2016-09-29T15:20:04.670 回答