代码之家  ›  专栏  ›  技术社区  ›  Arthur Frankel

Zend_信息卡作为Zend认证的一部分

  •  0
  • Arthur Frankel  · 技术社区  · 14 年前

    我正在尝试实现找到的这个基本示例 here :

    在标题为“作为Zend_认证的一部分使用”的部分下。

    我有Zend框架版本1.10,Apache2.2.11,我使用的是火狐,扩展名为“cardspace for firefox 3”。

    登录页面出现(从文档中的示例中复制),我可以选择一张信息卡(从卡选择器中)并“发送”,但返回时会出错:

    array
    0 => string 'Processing Failure' (length=18)
    1 => string 'Failed to extract assertion document' (length=36)
    

    在调试此错误时,错误由以下代码行引起(由于不存在类型而引发异常):

    在zend_infocard_xml_encrypteddata->getInstance()中,存在以下代码:

    $sxe = simplexml_load_string($strXmlData);
    switch($sxe['Type']) {
        case 'http://www.w3.org/2001/04/xmlenc#Element':
            include_once 'Zend/InfoCard/Xml/EncryptedData/XmlEnc.php';
            return simplexml_load_string($strXmlData, 'Zend_InfoCard_Xml_EncryptedData_XmlEnc');
        default:
            require_once 'Zend/InfoCard/Xml/Exception.php';
            throw new Zend_InfoCard_Xml_Exception("Unknown EncryptedData type found");
    break;
    

    问题是,当我将XML转储时,它中没有“type”。

    XML如下所示:

    <saml:Assertion MajorVersion="1" MinorVersion="1" AssertionID="SamlSecurityToken-9f068262-1b53-5cac-844e-624d589f9373" Issuer="http://schemas.xmlsoap.org/ws/2005/05/identity/issuer/self" IssueInstant="2010-07-08T15:08:48.343Z" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">
    

    ….并继续(带有签名值和其他项,但同样没有类型)。

    很明显我在这里做错了什么。我想知道这是否与火狐插件有关,或者是因为缺少使用SSL(目前不使用SSL)。

    1 回复  |  直到 14 年前
        1
  •  0
  •   wimvds    14 年前

    从文档中( http://framework.zend.com/manual/en/zend.infocard.basics.html#zend.infocard.basics.theory -在底部):

    注意,信息卡只能通过HTTP发送到SSL加密的URL。有关如何设置SSL加密,请查阅Web服务器的文档。