2
Springセキュリティ用のファイルにユーザー資格情報を格納および変更することは可能ですか?今のSpringセキュリティのファイルからユーザー資格情報の読み取り/追加
私が持っているの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-3.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security.xsd">
<http>
<intercept-url pattern="/**" access="ROLE_USER" />
<form-login />
<logout />
</http>
<authentication-manager>
<authentication-provider>
<user-service>
<user name="admin" password="admin" authorities="ROLE_USER, ROLE_ADMIN" />
<user name="user" password="user" authorities="ROLE_USER" />
</user-service>
</authentication-provider>
</authentication-manager>
をそして私が望むすべては/ユーザーを追加または変更する可能性USERS.TXTまたはusers.xmlのようにファイルの情報を格納することですパスワードはオンザフライで表示されます。
おかげで多くのことを、このクラスのBeanを追加するための
UserDetailsService
をオーバーライドする必要があります私のweb.xmlやapplicationContext.xmlに何かを追加すれば、ログインフォームが表示されません。 (今私はapplicationContextにsecurity.xmlをインポートします) –@ zelenov alekseyはapplicationContext.xml内のBeanを指摘してくれました。 –