【问题标题】:Receive a SAML message with LightSAML使用 LightSAML 接收 SAML 消息
【发布时间】:2020-07-09 14:53:30
【问题描述】:

我尝试在使用 LightSAML 的 AuthnRequest 成功后接收响应,并尝试使用官方文档 https://www.lightsaml.com/LightSAML-Core/Cookbook/How-to-receive-SAML-message/ 中的示例执行此操作,但我的响应为空,并在分配 $response 属性时收到警告:

使用'void'方法'receive'结果

出了什么问题,为什么我不能接受我的回复?

【问题讨论】:

    标签: php symfony saml-2.0


    【解决方案1】:

    经过一些搜索和此问题https://github.com/lightSAML/lightSAML/issues/95 的帮助后,我设法使用此代码获取用户的响应和属性:

    $request = \Symfony\Component\HttpFoundation\Request::createFromGlobals();
    $bindingFactory = new BindingFactory();
    $messageContext = new MessageContext();
    $binding = $bindingFactory->getBindingByRequest($request);
    $binding->receive($request, $messageContext);
    
    $attributes = $messageContext->asResponse()->getFirstAssertion()->getFirstAttributeStatement();
    

    我把它分享给你希望能帮助到别人。

    【讨论】:

      猜你喜欢
      • 2020-05-07
      • 2012-12-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-22
      • 2013-07-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多