Я пытаюсь реализовать аутентификацию Spring Security OAuth2, но кажется, что перенаправление OAuth2 не работает, вместо этого я получил стандартную форму входа безопасности Spring по умолчанию . Как клиент и основанный на этой ссылке и этой , я сделал мой конфиг, как показано ниже:
<beans:bean id="oauthAuthenticationEntryPoint" class="org.springframework.security.oauth2.provider.error.OAuth2AuthenticationEntryPoint"/>
<http auto-config="true" create-session="stateless">
<intercept-url pattern="/**" access="hasRole('ROLE_USER')" />
<custom-filter ref="oauth2ClientFilter" before="EXCEPTION_TRANSLATION_FILTER" />
<access-denied-handler ref="oauthAccessDeniedHandler" />
</http>
<authentication-manager>
<authentication-provider>
<user-service>
<user name="user"
password="user123"
authorities="ROLE_USER" />
</user-service>
</authentication-provider>
</authentication-manager>
<beans:bean id="oauthAccessDeniedHandler"
class="org.springframework.security.oauth2.provider.error.OAuth2AccessDeniedHandler">
</beans:bean>
<!--apply the oauth client context-->
<oauth:client id="oauth2ClientFilter" />
<!--define an oauth 2 resource for MyAuth-->
<oauth:resource id="myAuth" type="authorization_code" client-id="hidden"
client-secret="hiden" authentication-scheme="query"
access-token-uri="hiiiiidden"
user-authorization-uri="hiiiidden"
/>
<oauth:rest-template id="oauthRestTemplate" resource="myAuth" />
Есть ли у вас какие-либо идеи, что я мог бы бытьздесь отсутствует?
PS: К сожалению, я не могу реализовать это иначе, чем Конфигурация xml.
У меня также есть то же самое, что и здесь с тем же org.springframework.security.access.AccessDeniedException: Access is denied
, когдаотладка OAuth2ClientContextFilter.doFilter