Я пытаюсь настроить PreAuthenticationFilter в веб-приложении весны. Я выполняю эту official guide, и глядя на разделКонфигурация предварительной проверки подлинности безопасности
18.2.1 заголовка запроса аутентификации (Siteminder)
Вот мой security.xml файл, который описывает мои бобы и конфигурацию:
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-4.0.xsd"
xmlns:context="http://www.springframework.org/schema/context">
<beans:bean id="myFilter" class="com.MyFilter">
<beans:property name="authenticationManager" ref="authenticationManager" />
</beans:bean>
<beans:bean id="preauthAuthProvider" class="org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationProvider">
<beans:property name="preAuthenticatedUserDetailsService">
<beans:bean id="userDetailsServiceWrapper" class="org.springframework.security.core.userdetails.UserDetailsByNameServiceWrapper">
<beans:property name="userDetailsService" ref="userDetailsService"/>
</beans:bean>
</beans:property>
</beans:bean>
<authentication-manager alias="authenticationManager">
<authentication-provider ref="preauthAuthProvider" />
</authentication-manager>
<http auto-config="true" use-expressions="true" pattern="/**" >
<intercept-url pattern="/main/data" access="hasAnyRole('ROLE_ADMINISTRATORS')" requires-channel="https" />
<intercept-url pattern="/**" access="isAuthenticated()" requires-channel="any" />
<http-basic />
</http>
в принципе, единственное, что я чейнинга от руководства моя FilterId и класс. Все остальное - то же самое.
Ошибка я получаю это:
Cannot resolve reference to bean 'userDetailsService' while setting bean property 'userDetailsService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'userDetailsService' is defined
Что я здесь отсутствует? Этот класс уже находится в Spring Jar, который находится в моем проекте и может быть импортирован в любой класс.
вздохнув, ты прав. Я пропустил небольшой размер, обозначая, что вы должны реализовать свой собственный пользовательский сервис. В плагине grails 3, который делает то же самое, вы этого не делаете, поэтому небольшое расхождение вызвало проблему. – angryip