2011-09-05 63 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