|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.caucho.http.security.AbstractAuthenticator | +--com.caucho.http.security.XmlAuthenticator
The XML authenticator reads a static file for authentication.
The format of the static file is as follows:
<authenticator>
<user name='Harry Potter' password='quidditch'>
<role>user</role>
<role>gryffindor</role>
</user>
...
</authenticator>
The authenticator can also be configured in the web.xml:
<authenticator class-name='com.caucho.http.security.XmlAuthenticator'>
<init-param user='Harry Potter:quidditch:user,gryffindor'/>
</authenticator>
Fields inherited from class com.caucho.http.security.AbstractAuthenticator |
LOGIN_NAME, passwordDigest, passwordDigestName, principalCache, principalCacheSize |
Constructor Summary | |
XmlAuthenticator()
|
Method Summary | |
void |
addUser(java.lang.String userParam)
Adds a user from the configuration. |
protected java.lang.String |
getDigestPassword(HttpServletRequest request,
HttpServletResponse response,
ServletContext application,
java.lang.String userName,
java.lang.String realm)
Returns the password for authenticators too lazy to calculate the digest. |
Path |
getPath()
Gets the path to the XML file. |
void |
init()
Initialize the XML authenticator. |
boolean |
isUserInRole(HttpServletRequest request,
HttpServletResponse response,
ServletContext application,
java.security.Principal principal,
java.lang.String role)
Returns true if the user plays the named role. |
protected java.security.Principal |
loginImpl(HttpServletRequest request,
HttpServletResponse response,
ServletContext application,
java.lang.String userName,
java.lang.String password)
Authenticate (login) the user. |
void |
setPath(Path path)
Sets the path to the XML file. |
Methods inherited from class com.caucho.http.security.AbstractAuthenticator |
digest, getDigestSecret, getPasswordDigest, getPrincipalCacheSize, getUserPrincipal, getUserPrincipalImpl, login, loginDigest, loginDigestImpl, logout, setPasswordDigest, setPrincipalCacheSize |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XmlAuthenticator()
Method Detail |
public void setPath(Path path)
public Path getPath()
public void addUser(java.lang.String userParam)
<init-param user='Harry Potter:quidditch:user,webdav'/>
public void init() throws ServletException
init
in class AbstractAuthenticator
protected java.security.Principal loginImpl(HttpServletRequest request, HttpServletResponse response, ServletContext application, java.lang.String userName, java.lang.String password) throws ServletException
loginImpl
in class AbstractAuthenticator
protected java.lang.String getDigestPassword(HttpServletRequest request, HttpServletResponse response, ServletContext application, java.lang.String userName, java.lang.String realm) throws ServletException
AbstractAuthenticator
getDigestPassword
in class AbstractAuthenticator
public boolean isUserInRole(HttpServletRequest request, HttpServletResponse response, ServletContext application, java.security.Principal principal, java.lang.String role) throws ServletException
isUserInRole
in class AbstractAuthenticator
request
- the servlet requestuser
- the user to testrole
- the role to test
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |