Available Languages
Manual for Zend Framework 1.0.3
摘要式认证是一个HTTP认证的方法,它通过不需要通过网络传递明文密码的方法对基本认证加以改进。
这个适配器允许依靠文本文件认证,该文本包括数行摘要式认证的基本元素:
用户名,例如 "
joe.user"领域,例如 "
Administrative Area"用户名,领域和密码的MD5 hash用冒号隔开
在下面的例子中,上面的元素用冒号隔开(密码是"somePassword"):
someUser:Some Realm:fde17b91c3a510ecbaf7dbd37f59d4f8
摘要式认证适配器Zend_Auth_Adapter_Digest需要若干输入参数:
文件名 - 认证查询被执行是所需的文件名
领域 - 摘要式认证领域
用户名 - 摘要式认证用户
密码 - 该领域用户的密码
在调用authenticate()之前必需要设定这些参数。
摘要式认证返回一个Zend_Auth_Result 对象,它由包含realm和username健值的数组的身份形成。在authenticate()被调用之前,分别设置和这些健值关联的数组值为相符的值。
<?php
require_once 'Zend/Auth/Adapter/Digest.php';
$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
)
*/
Welcome!
Welcome to ZFResource - The Resource for the Zend Framework.
As you see, the website is in still in progress. Many features ( like Code Directory, Code Samples, User written Tutorials, Examples and News,...) will be online in near future.
At the moment, you can search and browse the manual in your language of
choice. Don't forget to come back later to benefit from the new features.
Help Wanted:
We are still searching for people want to help building this site. If you want to see this website in your language or you have any suggestions for this site please send us an email
