com.caucho.security
Class PropertiesAuthenticator

java.lang.Object
  extended by com.caucho.security.AbstractAuthenticator
      extended by com.caucho.security.PropertiesAuthenticator
All Implemented Interfaces:
HandleAware, Authenticator, java.io.Serializable
Direct Known Subclasses:
PropertyAuthenticator

@Service
public class PropertiesAuthenticator
extends AbstractAuthenticator

The Property authenticator reads a properties file for authentication.

 <sec:PropertiesAuthenticator path="WEB-INF/users.xml"/>
 

The format of the static file is as follows:

 h.potter=password,user,captain
 

The authenticator can also be configured in the resin-web.xml:

 <sec:PropertiesAuthenticator password-digest="none">
     Harry Potter=quidditch,user,captain
 </sec:PropertiesAuthenticator>
 

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.caucho.security.AbstractAuthenticator
_passwordDigest, _passwordDigestAlgorithm, _passwordDigestRealm
 
Constructor Summary
PropertiesAuthenticator()
           
 
Method Summary
 void addUser(java.lang.String name, java.lang.String password)
           
protected  PasswordUser createUser(java.lang.String name, java.lang.String value)
          Creates the password user based on a name and a comma-separated value
protected  PasswordUser getPasswordUser(java.lang.String userName)
          Returns the PasswordUser
 Path getPath()
          Gets the path to the property file.
 void init()
          Initialize the properties authenticator.
protected  void reload()
          Reload the authenticator.
 void setPath(Path path)
          Sets the path to the property file.
 void setValue(java.util.Properties value)
          Sets the properties value
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.security.AbstractAuthenticator
addRoleMapping, authenticate, authenticate, authenticate, authenticate, authenticate, digest, getAlgorithm, getDigest, getDigestSecret, getDigestSecret, getLogoutOnSessionTimeout, getPasswordDigest, getPasswordDigest, getPasswordDigestAlgorithm, getPasswordDigestRealm, getPasswordUser, getSingleSignon, isUserInRole, logout, setLogoutOnSessionTimeout, setPasswordDigest, setPasswordDigestAlgorithm, setPasswordDigestRealm, setSerializationHandle, stringToDigest, writeReplace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertiesAuthenticator

public PropertiesAuthenticator()
Method Detail

setPath

public void setPath(Path path)
Sets the path to the property file.


getPath

public Path getPath()
Gets the path to the property file.


setValue

public void setValue(java.util.Properties value)
Sets the properties value
 <init value='Harry Potter=quidditch,user,webdav'/>
 


addUser

public void addUser(java.lang.String name,
                    java.lang.String password)

init

@PostConstruct
public void init()
          throws ServletException
Initialize the properties authenticator.

Overrides:
init in class AbstractAuthenticator
Throws:
ServletException

getPasswordUser

protected PasswordUser getPasswordUser(java.lang.String userName)
Returns the PasswordUser

Overrides:
getPasswordUser in class AbstractAuthenticator
Parameters:
userName - the string user name
Returns:
the populated PasswordUser value

reload

protected void reload()
Reload the authenticator.


createUser

protected PasswordUser createUser(java.lang.String name,
                                  java.lang.String value)
Creates the password user based on a name and a comma-separated value


toString

public java.lang.String toString()
Overrides:
toString in class AbstractAuthenticator