JSF Web サイトに Spring Security 3.0.2 LDAP 認証を使用しようとしています。applicationContext-security.xml で以下の構成を使用すると、この例外が発生します - org.springframework.beans.factory.BeanCreationException: 'org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices#0' という名前の Bean を作成中にエラーが発生しました: Bean の初期化に失敗しました。ネストされた例外は org.springframework.context.ApplicationContextException: No UserDetailsService registered です。
<authentication-manager>
<ldap-authentication-provider
user-search-filter="(uid={0})" user-search-base="ou=users,ou=system"
group-search-base="ou=groups,ou=system">
</ldap-authentication-provider>
</authentication-manager>
<ldap-server id="ldapServer" url="ldap://localhost:10389"
root="" />
実験したところ、以下を追加するとうまくいくことがわかりました。
<ldap-user-service server-ref="ldapServer" user-search-filter="(uid={0})" />
しかし、Spring LDAP documentationでこれへの参照を見つけることができませんでした。これを追加しないと、なぜ上記の例外が発生するのですか? user-search-filter 属性を 2 か所に記述する必要があるため、この回避策には満足できません。
PS : Spring Security LDAP を確認しました - UserDetailsService が登録されていません。例外が異なり、Spring Security のバージョンも異なると思います。