How to change spring security oauth2 default token endpoint?

后端 未结 4 1972
被撕碎了的回忆
被撕碎了的回忆 2020-12-12 21:02

We have spring security oauth2 based application. Every thing is working fine. But i am failed to change default token endpoint from \"/oauth/token\" to \"/external/oauth/to

4条回答
  •  隐瞒了意图╮
    2020-12-12 21:35

    With the version 2.0.5.RELEASE or above of spring-security-oauth2

    In one line in java based configuration, tested and works fine, somehow it's overriding the RequestMapping value of the TokenEndpoint class.

    @Configuration
    @EnableAuthorizationServer
    protected static class AuthorizationServerConfiguration extends AuthorizationServerConfigurerAdapter {      
    
            @Override
            public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
                endpoints
                    .pathMapping("/oauth/token", "")
            }
    }
    

提交回复
热议问题