Введение в Zend Framework

 Learning Zend Framework

appendix

 Zend Framework Reference


  • Zend_Gdata
  • Zend_Http
  • Zend_InfoCard
  • Zend_Json
  • Zend_Layout
  • Zend_Ldap
  • Zend_Loader
  • Zend_Locale
  • Zend_Log
  • Zend_Mail
  • Zend_Markup
  • Zend_Measure
  • Zend_Memory
  • Zend_Mime
  • Zend_Navigation
  • Zend_Oauth
  • Zend_OpenId
  • Zend_Paginator
  • Zend_Pdf
  • Zend_ProgressBar
  • Zend_Queue
  • Zend_Reflection
  • Zend_Registry
  • Zend_Rest

  • Zend_Search_Lucene
  • Zend_Serializer
  • Zend_Server
  • Zend_Service
  • Zend_Session
  • Zend_Soap
  • Zend_Tag
  • Zend_Test
  • Zend_Text
  • Zend_TimeSync
  • Zend_Tool
  • Zend_Tool_Framework
  • Zend_Tool_Project
  • Zend_Translate
  • Zend_Uri
  • Zend_Validate
  • Zend_Version
  • Zend_View
  • Zend_Wildfire
  • Zend_XmlRpc
  • ZendX_Console_Process_Unix
  • ZendX_JQuery
  • Ttranslation 27.4% Update 2010-11-28 - Revision 23238 - Version ZF 1.11.x

    15.3. Digest Authentication

    15.3.1. Introduction

    Digest authentication is a method of HTTP authentication that improves upon Basic authentication by providing a way to authenticate without having to transmit the password in clear text across the network.

    This adapter allows authentication against text files containing lines having the basic elements of Digest authentication:

    • username, such as "joe.user"

    • realm, such as "Administrative Area"

    • MD5 hash of the username, realm, and password, separated by colons

    The above elements are separated by colons, as in the following example (in which the password is "somePassword"):

    someUser:Some Realm:fde17b91c3a510ecbaf7dbd37f59d4f8

    15.3.2. Specifics

    The digest authentication adapter, Zend_Auth_Adapter_Digest, requires several input parameters:

    • filename - Filename against which authentication queries are performed

    • realm - Digest authentication realm

    • username - Digest authentication user

    • password - Password for the user of the realm

    These parameters must be set prior to calling authenticate().

    15.3.3. Identity

    The digest authentication adapter returns a Zend_Auth_Result object, which has been populated with the identity as an array having keys of realm and username. The respective array values associated with these keys correspond to the values set before authenticate() is called.

    $adapter = new Zend_Auth_Adapter_Digest($filename,
                                            
    $realm,
                                            
    $username,
                                            
    $password);

    $result $adapter->authenticate();

    $identity $result->getIdentity();

    print_r($identity);

    /*
    Array
    (
        [realm] => Some Realm
        [username] => someUser
    )
    */
    digg delicious meneame google twitter technorati facebook

    Comments

    Loading...