Zend\Authentication\Adapter\Http
HTTP Authentication Adapter
Implements a pretty good chunk of RFC 2617.
Synopsis
class Http
implements
AdapterInterface
{
- // members
- protected Request $request;
- protected Response $response;
- protected ResolverInterface $basicResolver;
- protected ResolverInterface $digestResolver;
- protected array $supportedSchemes;
- protected array $acceptSchemes;
- protected string $domains;
- protected string $realm;
- protected int $nonceTimeout;
- protected bool $useOpaque;
- protected array $supportedAlgos;
- protected string $algo;
- protected array $supportedQops;
- protected bool $imaProxy;
- protected bool $ieNoOpaque;
- // methods
- public void __construct()
- public Http setBasicResolver()
- public ResolverInterface getBasicResolver()
- public Http setDigestResolver()
- public ResolverInterface getDigestResolver()
- public Http setRequest()
- public Request getRequest()
- public Http setResponse()
- public Response getResponse()
- public Result authenticate()
- protected Result _challengeClient()
- public Result challengeClient()
- protected string _basicHeader()
- protected string _digestHeader()
- protected Result _basicAuth()
- protected Result _digestAuth()
- protected string _calcNonce()
- protected string _calcOpaque()
- protected array|bool _parseDigestAuth()
Hierarchy
Implements
Tasks
Line | Task |
---|---|
27+ | Support auth-int |
27+ | Track nonces, nonce-count, opaque for replay protection and stale support |
27+ | Support Authentication-Info header |
Members
protected
- $acceptSchemes
—
array
List of schemes this class will accept from the client - $algo
—
string
The actual algorithm to use. Defaults to MD5 - $basicResolver
—
Zend\Authentication\Adapter\Http\ResolverInterface
Object that looks up user credentials for the Basic scheme - $digestResolver
—
Zend\Authentication\Adapter\Http\ResolverInterface
Object that looks up user credentials for the Digest scheme - $domains
—
string
Space-delimited list of protected domains for Digest Auth - $ieNoOpaque
—
Zend\Authentication\Adapter\bool
Flag indicating the client is IE and didn't bother to return the opaque string - $imaProxy
—
Zend\Authentication\Adapter\bool
Whether or not to do Proxy Authentication instead of origin server authentication (send 407's instead of 401's). Off by default. - $nonceTimeout
—
int
Nonce timeout period - $realm
—
string
The protection realm to use - $request
—
Zend\Http\Request
Reference to the HTTP Request object - $response
—
Zend\Http\Response
Reference to the HTTP Response object - $supportedAlgos
—
array
List of the supported digest algorithms. I want to support both MD5 and MD5-sess, but MD5-sess won't make it into the first version. - $supportedQops
—
array
List of supported qop options. My intention is to support both 'auth' and 'auth-int', but 'auth-int' won't make it into the first version. - $supportedSchemes
—
array
List of authentication schemes supported by this class - $useOpaque
—
Zend\Authentication\Adapter\bool
Whether to send the opaque value in the header. True by default
Methods
protected
- _basicAuth() — Basic Authentication
- _basicHeader() — Basic Header
- _calcNonce() — Calculate Nonce
- _calcOpaque() — Calculate Opaque
- _challengeClient()
- _digestAuth() — Digest Authentication
- _digestHeader() — Digest Header
- _parseDigestAuth() — Parse Digest Authorization header
public
- __construct() — Constructor
- authenticate() — Authenticate
- challengeClient() — Challenge Client
- getBasicResolver() — Getter for the basicResolver property
- getDigestResolver() — Getter for the digestResolver property
- getRequest() — Getter for the Request object
- getResponse() — Getter for the Response object
- setBasicResolver() — Setter for the basicResolver property
- setDigestResolver() — Setter for the digestResolver property
- setRequest() — Setter for the Request object
- setResponse() — Setter for the Response object