Spring WebアプリケーションでPreAuthenticationFilterを設定しようとしています。私はこのofficial guideを、以下、セクションで探していますSpring Security Preauthentication Config
は私の豆と構成の概要を説明し、私のsecurity.xmlファイル、次のとおりです。 を18.2.1リクエスト・ヘッダー認証(Siteminderの)ここで
<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>
基本的に、私はガイドからchaningています唯一の事は私の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にあり、どのクラスにもインポートできます。
ため息を参照する必要があり、あなたは正しいです。あなたが独自のuserdetailserviceを実装しなければならないことを意味する小さなフットプリントが欠けていました。 grails 3プラグインでは、同じことをしますが、そうではありません。したがって、小さな矛盾が問題を引き起こしました。 – angryip