再讲讲标签<authentication-manager>
该标签管理安全验证方案。 且看该标签的子标签 <authentication-provider>, 它的验证方案有三种:
1. user-service : 通过配置的用户名密码的方式实现安全验证。
2. jdbc-user-service: 通过数据库里面的用户名密码的方式实现方案验证。
3.ldap-user-service:通过ldap的方式验证用户名密码实现安全验证。
<authentication-provider>标签下还需要密码encode方案, <password-encoder>
总结下来, 一个简单的<authentication-manager>配置就是如下方案:
<authentication-manager>
<authentication-provider>
<password-encoder ref="encoder"/>
<user-service>
<user name="administrator" password="07a130111f1f911148fc3fa252add84a89fefb39fa4559648a08543f1b79cfbd74dfa6a05e389fc5" authorities="supervisor, user, teller" />
<user name="operator" password="270bbd890ad86ad4847a49c3b0058ccc3c4c9cfee31446b3cf032c0d4d15354b36473c0f063c6ce7" authorities="user" />
</user-service>
</authentication-provider>
</authentication-manager>
Spring Security 验证管理
本文介绍了 Spring Security 中 <authentication-manager> 标签的使用方法,包括三种验证方案:通过配置用户名密码、数据库及 LDAP 实现安全验证。同时讲解了密码编码配置。
2496

被折叠的 条评论
为什么被折叠?



