【问题标题】:Customizing TokenEndpoint in Spring OAuth2在 Spring OAuth2 中自定义 TokenEndpoint
【发布时间】:2016-11-12 20:57:34
【问题描述】:

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

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

【问题讨论】:

    标签: spring-oauth2


    【解决方案1】:

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

    @Primary
    @Bean
    public CustomTokenEndpoint tokenEndpoint() throws Exception {
    ...
    }
    

    【讨论】:

      猜你喜欢
      • 2015-11-18
      • 1970-01-01
      • 2015-12-30
      • 1970-01-01
      • 2019-08-07
      • 2017-04-13
      • 2016-11-05
      • 1970-01-01
      • 2013-09-25
      相关资源
      最近更新 更多