2011-09-05 69 views
0

我用弹簧安全登录选项。现在我想添加一个更改密码选项。首次登录到系统更改密码选项需要出现或重定向更改密码页面。 这是我的春天安全文件弹簧安全3如何更改密码

<bean id="daoAuthenticationProvider" 
    class="org.springframework.security.authentication.dao.DaoAuthenticationProvider"> 
    <property name="userDetailsService" ref="userDetailsService" /> 
</bean> 

<bean id="authenticationManager" 
    class="org.springframework.security.authentication.ProviderManager"> 
    <property name="providers"> 
     <list> 
      <ref local="daoAuthenticationProvider" /> 
     </list> 
    </property> 
</bean> 

<security:authentication-manager> 
    <security:authentication-provider user-service-ref="userDetailsService"> 
     <security:password-encoder ref="passwordEncoder"> 
      <security:salt-source ref="saltSource"/> 
     </security:password-encoder> 
    </security:authentication-provider> 
</security:authentication-manager> 

<bean id="saltSource" class="com.rcfi.lankaweb.linklk.support.service.SaltService"></bean> 

<bean id="passwordEncoder" class="com.rcfi.lankaweb.linklk.support.service.PasswordVerifier"></bean> 

<bean id="userDetailsService" 
    class="com.rcfi.lankaweb.linklk.support.service.UserDetailsServiceImpl"> 
</bean> 
+0

http://stackoverflow.com/questions/3335559/spring-security-custom-filter-change-password – Tristan

回答

0

com.rcfi.lankaweb.linklk.support.service.UserDetailsServiceImpl 创建一个修改密码的方法,这将采取新的字符串并保存到数据库中登录的用户,通过您的用户dao(大概)

+0

Thanx NimChimpsky,有你的想法,并做其余的。 – Amila