public class FormAuthentication extends AbstractAuthentication
Constructor and Description |
---|
FormAuthentication(java.lang.String theName,
java.lang.String thePassword) |
Modifier and Type | Method and Description |
---|---|
void |
authenticate(WebRequest theRequest,
Configuration theConfiguration)
Authenticate the principal by calling the security URL.
|
protected void |
checkAuthResponse(java.net.HttpURLConnection theConnection)
Check if the auth step can be considered as succeeded or not.
|
protected void |
checkPreAuthResponse(java.net.HttpURLConnection theConnection)
Check if the pre-auth step can be considered as succeeded or not.
|
void |
configure(org.apache.commons.httpclient.HttpState theState,
org.apache.commons.httpclient.HttpMethod theMethod,
WebRequest theRequest,
Configuration theConfiguration)
Modifies the request so that it will carry authentication information.
|
protected int |
getExpectedAuthResponse()
Get the expected HTTP response status code for an authentication request
which should be successful.
|
java.net.URL |
getSecurityCheckURL(Configuration theConfiguration)
This returns the URL to use when attempting to log in.
|
WebRequest |
getSecurityRequest() |
void |
setExpectedAuthResponse(int theExpectedCode)
Set the expected HTTP response status code for an authentication request
which should be successful.
|
void |
setSecurityCheckURL(java.net.URL theUrl)
This sets the URL to use when attempting to log in.
|
void |
setSessionCookieName(java.lang.String theName)
Set the cookie name of the session to theName.
|
getName, getPassword, setName, setPassword
public FormAuthentication(java.lang.String theName, java.lang.String thePassword)
theName
- user name of the CredentialthePassword
- user password of the Credentialpublic void configure(org.apache.commons.httpclient.HttpState theState, org.apache.commons.httpclient.HttpMethod theMethod, WebRequest theRequest, Configuration theConfiguration)
Authentication
theState
- The HttpClient state object that can be used to ask
HttpClient to set up authenticationtheMethod
- the HttpClient HTTP method that will be used to connect
to the server sidetheRequest
- 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(org.apache.commons.httpclient.HttpState, org.apache.commons.httpclient.HttpMethod, org.apache.cactus.WebRequest, org.apache.cactus.internal.configuration.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 configurationpublic void setSessionCookieName(java.lang.String theName)
JSESSIONID
".theName
- the cookie name of the sessionprotected int getExpectedAuthResponse()
public void setExpectedAuthResponse(int theExpectedCode)
theExpectedCode
- the expected HTTP response status code valueprotected void checkPreAuthResponse(java.net.HttpURLConnection theConnection) throws java.lang.Exception
theConnection
is less than 400.theConnection
- a HttpURLConnection
valuejava.lang.Exception
- if the pre-auth step should be considered as failedprotected void checkAuthResponse(java.net.HttpURLConnection theConnection) throws java.lang.Exception
theConnection
equals getExpectedAuthResponse()
.theConnection
- a HttpURLConnection
valuejava.lang.Exception
- if the auth step should be considered as failedpublic void authenticate(WebRequest theRequest, Configuration theConfiguration)
theRequest
- the web request used to connect to the RedirectortheConfiguration
- the Cactus configurationCopyright © 2000-2004 Apache Software Foundation. All Rights Reserved.