《Spring Security3》第四章第三部分翻译下(配置安全的密码)(转载)
《Spring Security3》第四章第三部分翻译上(配置安全的密码)(转载)?配置安全的密码?在Spring Security中,密
《Spring Security3》第四章第三部分翻译上(配置安全的密码)(转载)
?
配置安全的密码
?在Spring Security中,密码加密已经进行了封装,通过o.s.s.authentication.encoding.PasswordEncoder接口的实现类来定义。通过使用<authentication-provider>元素里的<password-encoder>声明我们能够很容易地配置密码编码:
<bean?class="com.packtpub.springsecurity.security.????????????????DatabasePasswordSecurerBean"????????????????init-method="secureDatabase"?depends-on="dataSource">????<property?name="dataSource"?ref="dataSource"/>??</bean>??
?如果你此时重启JBCP Pets应用,你会发现数据库中的密码已经进行了编码,登录功能可以正常使用了。