使用 LightSAML 接收 SAML 消息
Receive a SAML message with LightSAML
我尝试使用 LightSAML 在 AuthnRequest 成功后收到响应,并尝试使用官方文档中的示例来执行此操作 https://www.lightsaml.com/LightSAML-Core/Cookbook/How-to-receive-SAML-message/ 但是我的响应是空的,并且在分配 $response 属性 表示:
'void' method 'receive' result used
怎么了,为什么我不能接受我的回复?
经过一些搜索和这个问题的帮助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();
分享给大家,希望对大家有所帮助。
我尝试使用 LightSAML 在 AuthnRequest 成功后收到响应,并尝试使用官方文档中的示例来执行此操作 https://www.lightsaml.com/LightSAML-Core/Cookbook/How-to-receive-SAML-message/ 但是我的响应是空的,并且在分配 $response 属性 表示:
'void' method 'receive' result used
怎么了,为什么我不能接受我的回复?
经过一些搜索和这个问题的帮助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();
分享给大家,希望对大家有所帮助。