2013-05-09 22 views
0

我試圖在Spring安全性3中實現一個鹽源作爲我的安全性的一部分。我想要匿名用戶名,但爲了使用這個如下所示,我需要實現哪個域以利用彈簧安全的默認實現?使用鹽源bean,我需要實現哪個域?

<authentication-manager> 
    <authentication-provider user-service-ref="userDetailsService"> 
     <password-encoder hash="sha-256"> 
      <salt-source user-property="username" /> 
     </password-encoder> 
    </authentication-provider> 
</authentication-manager> 

回答

-1

我猜你的域指的是安全命名空間。 Spring Security命名空間配置的位置是:http://www.springframework.org/schema/security/spring-security.xsd(不要指定要針對最新版本解決的版本)。看看這個文檔:Spring Security Namespace Configuration

+0

不,我指的是一個有getters/setters的類。我需要實現哪個課程? – Bobby 2013-05-09 20:14:39

+0

如果你想創建自己的,而不是使用Spring的默認的,你必須實現'org.springframework.security.authentication.dao.SaltSource'接口。但這是*接口*,而不是*域*。 – Micho 2015-08-06 03:17:39