How to change spring security oauth2 default token endpoint?

后端 未结 4 1975
被撕碎了的回忆
被撕碎了的回忆 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条回答
  •  旧时难觅i
    2020-12-12 21:49

    For customize the token end point URL, do the following steps.

    1) Write your own class that extends ClientCredentialsTokenEndpointFilter class & call ClientCredentialsTokenEndpointFilter class constructor with "/external/oauth/token" value.

    super("/external/oauth/token");
    

    2) Plug your new customize filter in security configuration.

    Replace

    
    

    with

    
    

    3) Create your own class for new mapping (/external/oauth/token) & extend tokenendpoint.

    4) Change http & intercept-url element's pattern attribute value to "/external/oauth/token"

提交回复
热议问题