|
Apache CXF API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cxf.transport.http.HttpAuthSupplier org.apache.cxf.transport.http.HttpBasicAuthSupplier
public abstract class HttpBasicAuthSupplier
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.
Nested Class Summary | |
---|---|
static class |
HttpBasicAuthSupplier.UserPass
This class is used to return the values of the userid and password used in the HTTP Authorization Header. |
Field Summary |
---|
Fields inherited from class org.apache.cxf.transport.http.HttpAuthSupplier |
---|
logicalName |
Constructor Summary | |
---|---|
protected |
HttpBasicAuthSupplier()
The default constructor assigns the class name as the LogicalName. |
protected |
HttpBasicAuthSupplier(String name)
This constructor assigns the LogicalName of this HttpBasicAuthSupplier. |
Method Summary | |
---|---|
protected HttpBasicAuthSupplier.UserPass |
createUserPass(String userid,
String password)
This method is used by extensions of this class to create a UserPass to return. |
String |
getAuthorizationForRealm(HTTPConduit conduit,
URL currentURL,
Message message,
String realm,
String fullHeader)
The HTTPConduit makes a call to this method if it receives a 401 response to a particular URL for a given message. |
String |
getPreemptiveAuthorization(HTTPConduit conduit,
URL currentURL,
Message message)
The HTTPConduit makes a call to this method before connecting to the server behind a particular URL. |
abstract HttpBasicAuthSupplier.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 HttpBasicAuthSupplier.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. |
Methods inherited from class org.apache.cxf.transport.http.HttpAuthSupplier |
---|
getLogicalName, requiresRequestCaching |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected HttpBasicAuthSupplier()
protected HttpBasicAuthSupplier(String name)
name
- The Logical Name.Method Detail |
---|
public String getAuthorizationForRealm(HTTPConduit conduit, URL currentURL, Message message, String realm, String fullHeader)
HttpAuthSupplier
getAuthorizationForRealm
in class HttpAuthSupplier
conduit
- The conduit making the call.currentURL
- The current URL from which the reponse came.message
- The CXF Message.realm
- The realm extraced from the basic auth header.fullHeader
- The full WWW-Authenticate header
public String getPreemptiveAuthorization(HTTPConduit conduit, URL currentURL, Message message)
HttpAuthSupplier
getPreemptiveAuthorization
in class HttpAuthSupplier
conduit
- The HTTPConduit making the call.currentURL
- The URL to which the request is to be made.message
- The CXF Message.
protected HttpBasicAuthSupplier.UserPass createUserPass(String userid, String password)
userid
- The userid that will be returned from getUserid().
This argument must not contain a colon (":"). If
it does, it will throw an IllegalArgumentException.password
- The password that will be returned from getPassword().
public abstract HttpBasicAuthSupplier.UserPass getPreemptiveUserPass(String conduitName, URL currentURL, Message message)
conduitName
- The HTTPConduit making the call.currentURL
- The URL to which the request is to be made.message
- The CXF Message.
public abstract HttpBasicAuthSupplier.UserPass getUserPassForRealm(String conduitName, URL currentURL, Message message, String realm)
conduitName
- The name of the conduit making the call.currentURL
- The current URL from which the reponse came.message
- The CXF Message.realm
- The realm extraced from the basic auth header.
|
Apache CXF API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |