| java.lang.Object org.apache.cxf.transport.http.HttpBasicAuthSupplier
HttpBasicAuthSupplier | abstract public class HttpBasicAuthSupplier (Code) | | This abstract class is extended by developers who need HTTP Basic Auth
functionality on the client side. It supplies userid and password
combinations to an HTTPConduit.
The HTTPConduit will make a call to getPreemptiveUserPass before
an HTTP request is made. The HTTPConduit will call on
getUserPassForRealm upon getting a 401 HTTP Response with a
"WWW-Authenticate: Basic realm=????" header.
A HTTPConduit keeps a reference to this HttpBasicAuthSupplier for the life
of the HTTPConduit, unless changed out by dynamic configuration.
Therefore, an implementation of this HttpBasicAuthSupplier may maintain
state for subsequent calls.
For instance, an implemenation may not provide a UserPass preemptively for
a particular URL and decide to get the realm information from
a 401 response in which the HTTPConduit will call getUserPassForReam for
that URL. Then this implementation may provide the UserPass for this
particular URL preemptively for subsequent calls to getPreemptiveUserPass.
|
Inner Class :final public static class UserPass | |
Field Summary | |
protected String | logicalName This field contains the logical name of this HttpBasicAuthSuppler. |
Method Summary | |
protected UserPass | createUserPass(String userid, String password) This method is used by extensions of this class to create
a UserPass to return.
Parameters: userid - The userid that will be returned from getUserid().This argument must not contain a colon (":"). | public String | getLogicalName() This method returns the LogicalName of this HttpBasicAuthSupplier. | abstract public UserPass | getPreemptiveUserPass(String conduitName, URL currentURL, Message message) The HTTPConduit makes a call to this method before connecting
to the server behind a particular URL. | abstract public UserPass | getUserPassForRealm(String conduitName, URL currentURL, Message message, String realm) The HTTPConduit makes a call to this method if it
receives a 401 response to a particular URL for
a given message. |
logicalName | protected String logicalName(Code) | | This field contains the logical name of this HttpBasicAuthSuppler.
This field is not assigned to be final, since an extension may be
Spring initialized as a bean, have an appropriate setLogicalName
method, and set this field.
|
HttpBasicAuthSupplier | protected HttpBasicAuthSupplier()(Code) | | The default constructor assigns the class name as the LogicalName.
|
HttpBasicAuthSupplier | protected HttpBasicAuthSupplier(String name)(Code) | | This constructor assigns the LogicalName of this HttpBasicAuthSupplier.
Parameters: name - The Logical Name. |
createUserPass | protected UserPass createUserPass(String userid, String password)(Code) | | This method is used by extensions of this class to create
a UserPass to return.
Parameters: userid - The userid that will be returned from getUserid().This argument must not contain a colon (":"). Ifit does, it will throw an IllegalArgumentException. Parameters: password - The password that will be returned from getPassword(). |
getLogicalName | public String getLogicalName()(Code) | | This method returns the LogicalName of this HttpBasicAuthSupplier.
|
getPreemptiveUserPass | abstract public UserPass getPreemptiveUserPass(String conduitName, URL currentURL, Message message)(Code) | | The HTTPConduit makes a call to this method before connecting
to the server behind a particular URL. If this implementation does not
have a UserPass for this URL, it should return null.
Parameters: conduitName - The HTTPConduit making the call. Parameters: currentURL - The URL to which the request is to be made. Parameters: message - The CXF Message. This method returns null if no UserPass is available. |
getUserPassForRealm | abstract public UserPass getUserPassForRealm(String conduitName, URL currentURL, Message message, String realm)(Code) | | The HTTPConduit makes a call to this method if it
receives a 401 response to a particular URL for
a given message. The realm information is taken
from the "WWW-Authenticate: Basic realm=?????"
header. The current message may be retransmitted
if this call returns a UserPass. The current message will
fail with a 401 if null is returned. If no UserPass is available
for this particular URL, realm, and message, then null
should be returned.
Parameters: conduitName - The name of the conduit making the call. Parameters: currentURL - The current URL from which the reponse came. Parameters: message - The CXF Message. Parameters: realm - The realm extraced from the basic auth header. |
|
|