首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

《Spring Security3》第四章第三部分翻译下(配置安全的密码)(转载)

2012-09-09 
《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应用,你会发现数据库中的密码已经进行了编码,登录功能可以正常使用了。

热点排行