com.bradmcevoy.http.http11.auth
Class DigestAuthenticationHandler

java.lang.Object
  extended by com.bradmcevoy.http.http11.auth.DigestAuthenticationHandler
All Implemented Interfaces:
AuthenticationHandler

public class DigestAuthenticationHandler
extends java.lang.Object
implements AuthenticationHandler

Author:
brad

Constructor Summary
DigestAuthenticationHandler()
           
DigestAuthenticationHandler(NonceProvider nonceProvider)
           
 
Method Summary
 java.lang.Object authenticate(Resource r, Request request)
          Authenticate the details in the request for access to the given resource.
 java.lang.String getChallenge(Resource resource, Request request)
          Create a challenge for this authentication method.
 boolean isCompatible(Resource resource)
          Returns true if this authentication handler is compatible with the given resource This is used when authorisation has failed, in generating challenge responses If you don't want to add a challenge response, return false
 boolean supports(Resource r, Request request)
          Returns true if this supports authenticating with the given Auth data on the given resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DigestAuthenticationHandler

public DigestAuthenticationHandler(NonceProvider nonceProvider)

DigestAuthenticationHandler

public DigestAuthenticationHandler()
Method Detail

supports

public boolean supports(Resource r,
                        Request request)
Description copied from interface: AuthenticationHandler
Returns true if this supports authenticating with the given Auth data on the given resource. Only the first AuthenticationHandler which returns true for supports will be used for authentication. Ie supports implementations should be mutually exclusive

Specified by:
supports in interface AuthenticationHandler
Returns:

authenticate

public java.lang.Object authenticate(Resource r,
                                     Request request)
Description copied from interface: AuthenticationHandler
Authenticate the details in the request for access to the given resource.

Specified by:
authenticate in interface AuthenticationHandler
Returns:

getChallenge

public java.lang.String getChallenge(Resource resource,
                                     Request request)
Description copied from interface: AuthenticationHandler
Create a challenge for this authentication method. This should be completely formatted as per http://tools.ietf.org/html/rfc2617

Specified by:
getChallenge in interface AuthenticationHandler
Returns:

isCompatible

public boolean isCompatible(Resource resource)
Description copied from interface: AuthenticationHandler
Returns true if this authentication handler is compatible with the given resource This is used when authorisation has failed, in generating challenge responses If you don't want to add a challenge response, return false

Specified by:
isCompatible in interface AuthenticationHandler
Returns:
- true if this can authenticate the resource, and it should issue a http challenge


Copyright © 2011. All Rights Reserved.