org.springframework.security.authentication.dao
Class SystemWideSaltSource
java.lang.Object
org.springframework.security.authentication.dao.SystemWideSaltSource
- All Implemented Interfaces:
- org.springframework.beans.factory.InitializingBean, SaltSource
public class SystemWideSaltSource
- extends java.lang.Object
- implements SaltSource, org.springframework.beans.factory.InitializingBean
Uses a static system-wide String
as the salt.
Does not supply a different salt for each User
. This means users sharing the same password will still have the same digested
password. Of benefit is the digested passwords will at least be more protected than if stored without any salt.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SystemWideSaltSource
public SystemWideSaltSource()
afterPropertiesSet
public void afterPropertiesSet()
throws java.lang.Exception
- Specified by:
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
- Throws:
java.lang.Exception
getSalt
public java.lang.Object getSalt(UserDetails user)
- Description copied from interface:
SaltSource
- Returns the salt to use for the indicated user.
- Specified by:
getSalt
in interface SaltSource
- Parameters:
user
- from the AuthenticationDao
- Returns:
- the salt to use for this
UserDetails
getSystemWideSalt
public java.lang.String getSystemWideSalt()
setSystemWideSalt
public void setSystemWideSalt(java.lang.String systemWideSalt)