Apache CXF API

org.apache.cxf.transport.http
Class DigestAuthSupplier

java.lang.Object
  extended by org.apache.cxf.transport.http.HttpAuthSupplier
      extended by org.apache.cxf.transport.http.DigestAuthSupplier

public class DigestAuthSupplier
extends HttpAuthSupplier


Field Summary
 
Fields inherited from class org.apache.cxf.transport.http.HttpAuthSupplier
logicalName
 
Constructor Summary
DigestAuthSupplier()
           
 
Method Summary
 String createCnonce()
           
 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.
 boolean requiresRequestCaching()
          If the supplier requires the request to be cached to be resent, return true With digest, the nonce could expire and thus a rechallenge will be issued.
 
Methods inherited from class org.apache.cxf.transport.http.HttpAuthSupplier
getLogicalName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DigestAuthSupplier

public DigestAuthSupplier()
Method Detail

requiresRequestCaching

public boolean requiresRequestCaching()
If the supplier requires the request to be cached to be resent, return true With digest, the nonce could expire and thus a rechallenge will be issued. Thus, we need requests cached to be able to handle that

Overrides:
requiresRequestCaching in class HttpAuthSupplier

getAuthorizationForRealm

public String getAuthorizationForRealm(HTTPConduit conduit,
                                       URL currentURL,
                                       Message message,
                                       String realm,
                                       String fullHeader)
Description copied from class: HttpAuthSupplier
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: ???? realm=?????" header. The current message may be retransmitted if this call returns a Authorization. The current message will fail with a 401 if null is returned. If no Authorization is available for this particular URL, realm, and message, then null should be returned.

Specified by:
getAuthorizationForRealm in class HttpAuthSupplier
Parameters:
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
Returns:

getPreemptiveAuthorization

public String getPreemptiveAuthorization(HTTPConduit conduit,
                                         URL currentURL,
                                         Message message)
Description copied from class: HttpAuthSupplier
The HTTPConduit makes a call to this method before connecting to the server behind a particular URL. If this implementation does not have a Authorization for this URL, it should return null.

Specified by:
getPreemptiveAuthorization in class HttpAuthSupplier
Parameters:
conduit - The HTTPConduit making the call.
currentURL - The URL to which the request is to be made.
message - The CXF Message.
Returns:
This method returns null if no Authorization is available.

createCnonce

public String createCnonce()
                    throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

Apache CXF API

Apache CXF