com.caucho.server.security
Class XmlAuthenticator

java.lang.Object
  extended by com.caucho.server.security.AbstractAuthenticator
      extended by com.caucho.server.security.AbstractPasswordAuthenticator
          extended by com.caucho.server.security.XmlAuthenticator
All Implemented Interfaces:
ServletAuthenticator, HandleAware, java.io.Serializable
Direct Known Subclasses:
XmlAuthenticator

public class XmlAuthenticator
extends AbstractPasswordAuthenticator

The XML authenticator reads a static file for authentication.

 <authenticator url="xml:path=WEB-INF/users.xml"/>
 

The format of the static file is as follows:

 <users>
   <user name="h.potter" password="quidditch" roles="user,captain"/>
   ...
 </users>
 

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

 <authenticator url="xml:password-digest=none">
   <init>
     <user name="Harry Potter" password="quidditch" roles="user,captain"/>
   </init>
 </authenticator>
 

See Also:
Serialized Form

Nested Class Summary
static class XmlAuthenticator.User
           
 
Field Summary
 
Fields inherited from class com.caucho.server.security.AbstractAuthenticator
_passwordDigest, _passwordDigestAlgorithm, _passwordDigestRealm, _principalCache, _principalCacheSize, LOGIN_NAME
 
Constructor Summary
XmlAuthenticator()
           
 
Method Summary
 void addUser(XmlAuthenticator.User user)
          Adds a user from the configuration.
 Path getPath()
          Gets the path to the XML file.
protected  PasswordUser getUser(java.lang.String userName)
          Returns the PasswordUser
 void init()
          Initialize the XML authenticator.
 void reload()
          Reload the authenticator.
 void setPath(Path path)
          Sets the path to the XML file.
 
Methods inherited from class com.caucho.server.security.AbstractPasswordAuthenticator
getDigestPassword, getUser, isUserInRole, loginImpl
 
Methods inherited from class com.caucho.server.security.AbstractAuthenticator
addRoleMapping, digest, getDigestSecret, getLogoutOnSessionTimeout, getPasswordDigest, getPasswordDigest, getPasswordDigestAlgorithm, getPasswordDigestRealm, getPrincipalCacheSize, getUserPrincipal, getUserPrincipalImpl, login, loginDigest, loginDigestImpl, logout, logout, logout, setLogoutOnSessionTimeout, setPasswordDigest, setPasswordDigestAlgorithm, setPasswordDigestRealm, setPrincipalCacheSize, setSerializationHandle, stringToDigest, toString, writeReplace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XmlAuthenticator

public XmlAuthenticator()
Method Detail

setPath

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


getPath

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


addUser

public void addUser(XmlAuthenticator.User user)
Adds a user from the configuration.
 <init user='Harry Potter:quidditch:user,webdav'/>
 


init

public void init()
          throws ServletException
Initialize the XML authenticator.

Specified by:
init in interface ServletAuthenticator
Overrides:
init in class AbstractAuthenticator
Throws:
ServletException

getUser

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

Specified by:
getUser in class AbstractPasswordAuthenticator
Parameters:
userName - the string user name
Returns:
the populated PasswordUser value

reload

public void reload()
Reload the authenticator.