1 <?xml version="1.0" encoding="UTF-8"?>
3 <sect1 id="zend.auth.adapter.digest">
4 <title>Digest Authentication</title>
6 <sect2 id="zend.auth.adapter.digest.introduction">
7 <title>Introduction</title>
10 <ulink url="http://en.wikipedia.org/wiki/Digest_access_authentication">Digest
11 authentication</ulink> is a method of <acronym>HTTP</acronym> authentication that
13 url="http://en.wikipedia.org/wiki/Basic_authentication_scheme">Basic
14 authentication</ulink> by providing a way to authenticate without having to
15 transmit the password in clear text across the network.
19 This adapter allows authentication against text files containing lines having the basic
20 elements of Digest authentication:
26 username, such as "<emphasis><filename>joe.user</filename></emphasis>"
32 realm, such as "<emphasis>Administrative Area</emphasis>"
38 <acronym>MD5</acronym> hash of the username, realm, and password, separated
45 The above elements are separated by colons, as in the following example (in which the
46 password is "<emphasis>somePassword</emphasis>"):
49 <programlisting language="txt"><![CDATA[
50 someUser:Some Realm:fde17b91c3a510ecbaf7dbd37f59d4f8
54 <sect2 id="zend.auth.adapter.digest.specifics">
55 <title>Specifics</title>
58 The digest authentication adapter, <classname>Zend_Auth_Adapter_Digest</classname>,
59 requires several input parameters:
65 filename - Filename against which authentication queries are performed
71 realm - Digest authentication realm
77 username - Digest authentication user
83 password - Password for the user of the realm
89 These parameters must be set prior to calling <methodname>authenticate()</methodname>.
93 <sect2 id="zend.auth.adapter.digest.identity">
94 <title>Identity</title>
97 The digest authentication adapter returns a <classname>Zend_Auth_Result</classname>
98 object, which has been populated with the identity as an array having keys of
99 <emphasis>realm</emphasis> and <emphasis>username</emphasis>. The respective array
100 values associated with these keys correspond to the values set before
101 <methodname>authenticate()</methodname> is called.
104 <programlisting language="php"><![CDATA[
105 $adapter = new Zend_Auth_Adapter_Digest($filename,
110 $result = $adapter->authenticate();
112 $identity = $result->getIdentity();
119 [realm] => Some Realm
120 [username] => someUser