Class Zend_Auth_Adapter_Http

Description

Implements interfaces:

HTTP Authentication Adapter

Implements a pretty good chunk of RFC 2617.

  • copyright: Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
  • todo: Support auth-int
  • todo: Track nonces, nonce-count, opaque for replay protection and stale support
  • todo: Support Authentication-Info header
  • license: New BSD License

Located in /Auth/Adapter/Http.php (line 45)


	
			
Variable Summary
Method Summary
Variables
array $_acceptSchemes (line 87)

List of schemes this class will accept from the client

  • access: protected
string $_algo (line 130)

The actual algorithm to use. Defaults to MD5

  • access: protected
Zend_Auth_Adapter_Http_Resolver_Interface $_basicResolver (line 66)

Object that looks up user credentials for the Basic scheme

  • access: protected
Zend_Auth_Adapter_Http_Resolver_Interface $_digestResolver (line 73)

Object that looks up user credentials for the Digest scheme

  • access: protected
string $_domains (line 94)

Space-delimited list of protected domains for Digest Auth

  • access: protected
boolean $_ieNoOpaque (line 153)

Flag indicating the client is IE and didn't bother to return the opaque string

  • access: protected
boolean $_imaProxy (line 146)

Whether or not to do Proxy Authentication instead of origin server authentication (send 407's instead of 401's). Off by default.

  • access: protected
integer $_nonceTimeout (line 108)

Nonce timeout period

  • access: protected
string $_realm (line 101)

The protection realm to use

  • access: protected
Zend_Controller_Request_Http $_request (line 52)

Reference to the HTTP Request object

  • access: protected
Zend_Controller_Response_Http $_response (line 59)

Reference to the HTTP Response object

  • access: protected
array $_supportedAlgos = array('MD5') (line 123)

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.

  • access: protected
array $_supportedQops = array('auth') (line 138)

List of supported qop options. My intetion is to support both 'auth' and 'auth-int', but 'auth-int' won't make it into the first version.

  • access: protected
array $_supportedSchemes = array('basic', 'digest') (line 80)

List of authentication schemes supported by this class

  • access: protected
boolean $_useOpaque (line 115)

Whether to send the opaque value in the header. True by default

  • access: protected
Methods
Constructor __construct (line 169)

Constructor

  • throws: Zend_Auth_Adapter_Exception
  • access: public
void __construct ( $config)
  • array $config: Configuration settings: 'accept_schemes' => 'basic'|'digest'|'basic digest' 'realm' => <string> 'digest_domains' => <string> Space-delimited list of URIs 'nonce_timeout' => <int> 'use_opaque' => <bool> Whether to send the opaque value in the header 'alogrithm' => <string> See $_supportedAlgos. Default: MD5 'proxy_auth' => <bool> Whether to do authentication as a Proxy
authenticate (line 357)

Authenticate

  • throws: Zend_Auth_Adapter_Exception
  • access: public
Zend_Auth_Result authenticate ()

Implementation of:
Zend_Auth_Adapter_Interface::authenticate()
Performs an authentication attempt
getBasicResolver (line 277)

Getter for the _basicResolver property

  • access: public
getDigestResolver (line 300)

Getter for the _digestResolver property

  • access: public
getRequest (line 323)

Getter for the Request object

  • access: public
getResponse (line 346)

Getter for the Response object

  • access: public
setBasicResolver (line 265)

Setter for the _basicResolver property

  • return: Provides a fluent interface
  • access: public
setDigestResolver (line 288)

Setter for the _digestResolver property

  • return: Provides a fluent interface
  • access: public
setRequest (line 311)

Setter for the Request object

  • return: Provides a fluent interface
  • access: public
Zend_Auth_Adapter_Http setRequest ( $request)
setResponse (line 334)

Setter for the Response object

  • return: Provides a fluent interface
  • access: public
Zend_Auth_Adapter_Http setResponse ( $response)
_basicAuth (line 486)

Basic Authentication

  • throws: Zend_Auth_Adapter_Exception
  • access: protected
Zend_Auth_Result _basicAuth (string $header)
  • string $header: Client's Authorization header
_basicHeader (line 454)

Basic Header

Generates a Proxy- or WWW-Authenticate header value in the Basic authentication scheme.

  • return: Authenticate header value
  • access: protected
string _basicHeader ()
_calcNonce (line 642)

Calculate Nonce

  • return: The nonce value
  • access: protected
string _calcNonce ()
_calcOpaque (line 671)

Calculate Opaque

The opaque string can be anything; the client must return it exactly as it was sent. It may be useful to store data in this string in some applications. Ideally, a new value for this would be generated each time a WWW-Authenticate header is sent (in order to reduce predictability), but we would have to be able to create the same exact value across at least two separate requests from the same client.

  • return: The opaque value
  • access: protected
string _calcOpaque ()
_challengeClient (line 420)

Challenge Client

Sets a 401 or 407 Unauthorized response code, and creates the appropriate Authenticate header(s) to prompt for credentials.

  • return: Always returns a non-identity Auth result
  • access: protected
Zend_Auth_Result _challengeClient ()
_digestAuth (line 542)

Digest Authentication

  • return: Valid auth result only on successful auth
  • throws: Zend_Auth_Adapter_Exception
  • access: protected
Zend_Auth_Result _digestAuth (string $header)
  • string $header: Client's Authorization header
_digestHeader (line 467)

Digest Header

Generates a Proxy- or WWW-Authenticate header value in the Digest authentication scheme.

  • return: Authenticate header value
  • access: protected
string _digestHeader ()
_parseDigestAuth (line 683)

Parse Digest Authorization header

  • return: Data elements from header, or false if any part of the header is invalid
  • access: protected
array|false _parseDigestAuth (string $header)
  • string $header: Client's Authorization: HTTP header

Documentation generated on Sun, 27 May 2007 23:24:37 -0700 by phpDocumentor 1.3.2