Customizing TokenEndpoint in Spring OAuth2

ぐ巨炮叔叔 提交于 2020-01-03 05:41:08

问题


First of all, I have already went through the previous questions on this subject.

I am trying to customize implementations of org.springframework.security.oauth2.provider.endpoint.TokenEndpoint and CheckTokenEndpoint. I can easily do that but I don't know how to plug that customized implementation in Spring Oauth2 Architecture. I am using @EnableAuthorizationServer annotation in my application. Could someone shed some light?


回答1:


Look at AuthorizationServerEndpointsConfiguration class. There are @Bean definitions of endpoints. Try to register your endpoint definition beans with the same names and register them as @Primary @Bean

i.e

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


来源:https://stackoverflow.com/questions/38298009/customizing-tokenendpoint-in-spring-oauth2

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!