org.springframework.security.authentication.dao
Class SystemWideSaltSource

java.lang.Object
  extended by org.springframework.security.authentication.dao.SystemWideSaltSource
All Implemented Interfaces:
InitializingBean, SaltSource

public class SystemWideSaltSource
extends Object
implements SaltSource, 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.

Version:
$Id: SystemWideSaltSource.java 3650 2009-05-11 05:18:20Z ltaylor $
Author:
Ben Alex

Constructor Summary
SystemWideSaltSource()
           
 
Method Summary
 void afterPropertiesSet()
           
 Object getSalt(UserDetails user)
          Returns the salt to use for the indicated user.
 String getSystemWideSalt()
           
 void setSystemWideSalt(String systemWideSalt)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemWideSaltSource

public SystemWideSaltSource()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

getSalt

public 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 String getSystemWideSalt()

setSystemWideSalt

public void setSystemWideSalt(String systemWideSalt)


Copyright © 2004-2009 SpringSource, Inc. All Rights Reserved.