Как изменить конечную точку токена безопасности Spring Security oauth2 по умолчанию?

У нас есть приложение на основе весенней безопасности oauth2. Все работает нормально. Но мне не удалось изменить конечную точку токена по умолчанию с "/ oauth / token" на "/ external / oauth / token".

Моя весна-сервлет.xml

<http pattern="/external/oauth/token" create-session="stateless" 
       authentication-manager-ref="clientAuthenticationManager"
       use-expressions="true" xmlns="http://www.springframework.org/schema/security">
      <intercept-url pattern="/external/oauth/token" access="isFullyAuthenticated()" />
      <anonymous enabled="false" />
      <http-basic entry-point-ref="clientAuthenticationEntryPoint" />
      <!-- include this only if you need to authenticate clients via request parameters -->
      <custom-filter ref="clientCredentialsTokenEndpointFilter" after="BASIC_AUTH_FILTER" />
      <access-denied-handler ref="oauthAccessDeniedHandler"/>
</http>

<oauth:authorization-server client-details-service-ref="clientDetails" 
        token-services-ref="tokenServices" 
        user-approval-handler-ref="userApprovalHandler" token-endpoint-url="/external/oauth/token">
        <oauth:authorization-code />
        <oauth:implicit />
        <oauth:refresh-token />
        <oauth:client-credentials />
        <oauth:password />
</oauth:authorization-server>

Но результат, когда я получаю доступ к этой конечной точке

{
    error: "unauthorized"
    error_description: "An Authentication object was not found in the SecurityContext"
}

я что-то пропустил? Пожалуйста, предложите.

Ответы на вопрос(4)

Ваш ответ на вопрос