|
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
public abstract class HttpAuthSupplier
This abstract class is extended by developers who need HTTP Auth functionality on the client side. It supplies Authorization information to an HTTPConduit.
The HTTPConduit will make a call to getPreemptiveAuthorization before an HTTP request is made. The HTTPConduit will call on getAuthorizationForRealm upon getting a 401 HTTP Response with a "WWW-Authenticate: Basic realm=????" header.
A HTTPConduit keeps a reference to this HttpAuthSupplier for the life of the HTTPConduit, unless changed out by dynamic configuration. Therefore, an implementation of this HttpAuthSupplier may maintain state for subsequent calls.
For instance, an implementation may not provide a Authorization preemptively for a particular URL and decide to get the realm information from a 401 response in which the HTTPConduit will call getAuthorizationForReam for that URL. Then this implementation may provide the Authorization for this particular URL preemptively for subsequent calls to getPreemptiveAuthorization.
Field Summary | |
---|---|
protected String |
logicalName
This field contains the logical name of this HttpBasicAuthSuppler. |
Constructor Summary | |
---|---|
protected |
HttpAuthSupplier()
The default constructor assigns the class name as the LogicalName. |
protected |
HttpAuthSupplier(String name)
This constructor assigns the LogicalName of this HttpBasicAuthSupplier. |
Method Summary | |
---|---|
abstract 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 |
getLogicalName()
This method returns the LogicalName of this HttpBasicAuthSupplier. |
abstract 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. |
boolean |
requiresRequestCaching()
If the supplier requires the request to be cached to be resent, return true |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String logicalName
Constructor Detail |
---|
protected HttpAuthSupplier()
protected HttpAuthSupplier(String name)
name
- The Logical Name.Method Detail |
---|
public String getLogicalName()
public boolean requiresRequestCaching()
public abstract String getPreemptiveAuthorization(HTTPConduit conduit, URL currentURL, Message message)
conduit
- The HTTPConduit making the call.currentURL
- The URL to which the request is to be made.message
- The CXF Message.
public abstract String getAuthorizationForRealm(HTTPConduit conduit, URL currentURL, Message message, String realm, String fullHeader)
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
|
Apache CXF API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |