|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cactus.client.authentication.AbstractAuthentication org.apache.cactus.client.authentication.FormAuthentication
Form-based authentication implementation. An instance of this class can be reused across several tests as it caches the session cookie. Thus the first time it is used to authenticate the user, it calls the security URL (which is by default the context URL prepended by "j_security_check"), caches the returned session cookie and adds the cookie for the next request. The second time it is called, it simply addes the session cookie for the next request.
Field Summary |
Fields inherited from class org.apache.cactus.client.authentication.AbstractAuthentication |
name, password |
Constructor Summary | |
FormAuthentication(java.lang.String theName,
java.lang.String thePassword)
|
Method Summary | |
void |
authenticate(WebRequest theRequest,
Configuration theConfiguration)
Authenticate the principal by calling the security URL. |
void |
configure(WebRequest theRequest,
Configuration theConfiguration)
Modifies the request so that it will carry authentication information. |
java.net.URL |
getSecurityCheckURL(Configuration theConfiguration)
This returns the URL to use when attempting to log in. |
WebRequest |
getSecurityRequest()
|
void |
setSecurityCheckURL(java.net.URL theUrl)
This sets the URL to use when attempting to log in. |
protected void |
validateName(java.lang.String theName)
Verify that the user name passed as parameter is a valid user name for the current authentication scheme. |
protected void |
validatePassword(java.lang.String thePassword)
Verify that the user password passed as parameter is a valid user password for the current authentication scheme. |
Methods inherited from class org.apache.cactus.client.authentication.AbstractAuthentication |
getName, getPassword, setName, setPassword |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FormAuthentication(java.lang.String theName, java.lang.String thePassword)
theName
- user name of the CredentialthePassword
- user password of the CredentialMethod Detail |
protected void validateName(java.lang.String theName)
AbstractAuthentication
validateName
in class AbstractAuthentication
theName
- the user name to validateAbstractAuthentication.validateName(String)
protected void validatePassword(java.lang.String thePassword)
AbstractAuthentication
validatePassword
in class AbstractAuthentication
thePassword
- the user password to validateAbstractAuthentication.validatePassword(String)
public void configure(WebRequest theRequest, Configuration theConfiguration)
Authentication
theRequest
- The request object that will be sent to the Cactus
Redirector over HTTPtheConfiguration
- The Cactus configuration so that
authentication methods can get access to Cactus configuration
propertiesAuthentication.configure(WebRequest, Configuration)
public WebRequest getSecurityRequest()
WebRequest
that will be used to connect to the
security URL. It can be used to add additional HTTP parameters such
as proprietary ones required by some containers.public void setSecurityCheckURL(java.net.URL theUrl)
theUrl
- A URL to use to attempt to login.public java.net.URL getSecurityCheckURL(Configuration theConfiguration)
theConfiguration
- the Cactus configuration
public void authenticate(WebRequest theRequest, Configuration theConfiguration)
theRequest
- the web request used to connect to the Redirector
* @param theConfiguration the Cactus configuration
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |