我嘗試使用 LightSAML 成功接收 AuthnRequest 后的響應,并嘗試使用官方文檔https://www.lightsaml.com/LightSAML-Core/Cookbook/How-to-receive-SAML-message/中的示例來執行此操作,但我的響應為空,并在 $response 屬性的分配中收到警告:使用“void”方法“接收”結果出了什么問題以及為什么我無法接受我的回復?
1 回答

DIEA
TA貢獻1820條經驗 獲得超2個贊
經過一些搜索和此問題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();
我與您分享希望對某人有所幫助。
- 1 回答
- 0 關注
- 143 瀏覽
添加回答
舉報
0/150
提交
取消