SimpleSAMLphp状态信息丢失

SimpleSAMLphp状态信息丢失,php,saml,simplesamlphp,Php,Saml,Simplesamlphp,我有一个服务提供商在。我有一个IdP设置在 在使用工具测试身份验证时,一切正常。它带着所需的属性返回到开发人员站点,所有人都很开心 然而,当我试图在代码中实际点击IdP时,我被重定向到Stage log in页面,但在登录后,我得到一个“State information lost”(状态信息丢失)错误。我获得以下调试信息: SimpleSAML_Error_NoState: NOSTATE Backtrace: 2 /webdevroot/Updraft/web/external/Syste

我有一个服务提供商在。我有一个IdP设置在

在使用工具测试身份验证时,一切正常。它带着所需的属性返回到开发人员站点,所有人都很开心

然而,当我试图在代码中实际点击IdP时,我被重定向到Stage log in页面,但在登录后,我得到一个“State information lost”(状态信息丢失)错误。我获得以下调试信息:

SimpleSAML_Error_NoState: NOSTATE

Backtrace:
2 /webdevroot/Updraft/web/external/System/SSO/simplesaml/lib/SimpleSAML/Auth/State.php:225 (SimpleSAML_Auth_State::loadState)
1 /webdevroot/Updraft/web/external/System/SSO/simplesaml/modules/saml/www/sp/saml2-acs.php:63 (require)
0 /webdevroot/Updraft/web/external/System/SSO/simplesaml/www/module.php:134 (N/A)
我已经完成了页面要求我做的所有故障排除,但情况仍然存在

我在浏览器上打开了开发工具并查看了cookie信息。biz.dev.originsystems.co.za的cookies包含一个SimpleAllauthToken,因此我认为cookies可以正常工作。我用来攻击IdP的代码是:

$as = new SimpleSAML_Auth_Simple("stage-sso-sp");
$as->requireAuth();
$attributes = $as->getAttributes();
print_r($attributes);
更新:

这里有更多的信息

我想确定问题是否出在我如何设置IdP上,所以我开始对IdP使用SSO循环。在SSO圈上进行身份验证后,状态信息也会丢失。我认为这意味着问题出在我的SimpleSAML服务提供商设置的某个地方。下面是正在发生的事情

当我转到的SimpleSAML测试验证源页面时,我有以下cookie值

Name                                       Value
SimpleSAMLAuthToken                        _a53569c0701dd02832532df14cf10cd0b2d9fcd6b6
biz.stage.originsystems.co.za              10fc356e0bfbf707af5fa5854c378755
ccof                                       RGN002
xbrF                                       84aadc624fc51c0c9340d45645c08643
除了SimpleSAMLAuthToken之外的所有内容都来自我们的应用程序,不应影响SimpleSAML。一旦重定向到SSO Circle并通过身份验证,我将返回SimpleSAML页面,身份验证令牌现在的值为
\u 39679E07CB1911E08B2BFF3580A9929FADD07E9B6
,并且正确返回了所有相关信息。日志文件显示以下活动

Feb 02 12:58:22 simplesamlphp DEBUG [7c4534ae0a] Received SAML2 Response from 'http://idp.ssocircle.com'.
Feb 02 12:58:22 simplesamlphp DEBUG [7c4534ae0a] No certificate in message when validating against fingerprint.
Feb 02 12:58:22 simplesamlphp DEBUG [7c4534ae0a] Found 1 certificates in SAML2_Assertion
Feb 02 12:58:22 simplesamlphp DEBUG [7c4534ae0a] Has 1 candidate keys for validation.
Feb 02 12:58:22 simplesamlphp DEBUG [7c4534ae0a] Validation with key #0 succeeded.
Feb 02 12:58:22 simplesamlphp DEBUG [7c4534ae0a] Filter config for http://idp.ssocircle.com->https://biz.stage.originsystems.co.za/simplesaml/module.php/saml/sp/metadata.php/default-sp: array (  0 =>   sspmod_core_Auth_Process_LanguageAdaptor::__set_state(array(     'langattr' => 'preferredLanguage',     'priority' => 90,  )),)
Feb 02 12:58:22 simplesamlphp DEBUG [7c4534ae0a] Deleting state: '_742b094314383407864f56bccc6afd7de3dcb3211e'
Feb 02 12:58:22 simplesamlphp DEBUG [7c4534ae0a] Session: doLogin("default-sp")
Feb 02 12:58:22 simplesamlphp DEBUG [7c4534ae0a] Session: Valid session found with 'default-sp'.
Feb 02 12:58:22 simplesamlphp DEBUG [7c4534ae0a] Session: Valid session found with 'default-sp'.
Feb 02 12:58:22 simplesamlphp DEBUG [7c4534ae0a] Template: Reading [/OriginSystems/application/Updraft/web/external/System/SSO/simplesaml/dictionaries/status]
Feb 02 12:58:22 simplesamlphp DEBUG [7c4534ae0a] Template: Reading [/OriginSystems/application/Updraft/web/external/System/SSO/simplesaml/dictionaries/attributes]
Feb 02 12:58:22 simplesamlphp DEBUG [7c4534ae0a] Template: Reading [/OriginSystems/application/Updraft/web/external/System/SSO/simplesaml/modules/core/dictionaries/frontpage]
如果我转到,我将被重定向到SSO循环,然后在那里进行身份验证。此时,我的Autth令牌的值为
\u 39679E07CB1911E08B2BFF3580A9929FADD07E9B6
。一旦我通过身份验证,我将被引导到SimpleSAML错误页面“状态信息丢失”,身份验证令牌仍然是
\u 39679E07CB1911E08B2BFF3580A9929FADD07E9B6

日志上写着

Feb 02 13:08:31 simplesamlphp DEBUG [8abc64dd04] Loading state: '_498e7d4d75bb7716e5e8cf905e0da5ef1c40cf1b3f'
Feb 02 13:08:31 simplesamlphp ERROR [8abc64dd04] SimpleSAML_Error_NoState: NOSTATE
Feb 02 13:08:31 simplesamlphp ERROR [8abc64dd04] Backtrace:
Feb 02 13:08:31 simplesamlphp ERROR [8abc64dd04] 2 /OriginSystems/application/Updraft/web/external/System/SSO/simplesaml/lib/SimpleSAML/Auth/State.php:225 (SimpleSAML_Auth_State::loadState)
Feb 02 13:08:31 simplesamlphp ERROR [8abc64dd04] 1 /OriginSystems/application/Updraft/web/external/System/SSO/simplesaml/modules/saml/www/sp/saml2-acs.php:63 (require)
Feb 02 13:08:31 simplesamlphp ERROR [8abc64dd04] 0 /OriginSystems/application/Updraft/web/external/System/SSO/simplesaml/www/module.php:134 (N/A)
Feb 02 13:08:31 simplesamlphp ERROR [8abc64dd04] Error report with id dfbb52b0 generated.
Feb 02 13:08:31 simplesamlphp DEBUG [8abc64dd04] Template: Reading [/OriginSystems/application/Updraft/web/external/System/SSO/simplesaml/dictionaries/errors]
Feb 02 13:08:31 simplesamlphp DEBUG [8abc64dd04] Template: Reading [/OriginSystems/application/Updraft/web/external/System/SSO/simplesaml/modules/core/dictionaries/no_state]

在我看来,身份验证令牌应该是
\u 498e7d4d75bb7716e5e8cf905e0da5ef1c40cf1b3f
,但出于某种原因不是这样。由于SimpleSAML无法找到该标记,因此它从不删除旧标记并创建新标记。也许我错了。我完全愿意被纠正。我的问题是,我不知道是什么导致了这一切。我已经将配置文件中的cookie.name设置为“biz.stage.originsystems.co.za”,这对于SimpleSAML控制面板来说似乎很好,但在实际应用程序中使用SP时却不起作用。有人能给我指一下正确的方向吗?我迷路了。

您必须定义两个完全独立的环境,以避免将您描述的两个环境(具有两个完全不同的身份提供者)混合在一起(这显然不起作用,除非已将两者都添加到SSO配置中——这可能不是理想的结果);只需检查服务器的主机名并相应地定义变量——这可以“动态”完成,也可以通过两个不同的配置文件完成(实际上,在部署结束时推送配置文件是很常见的)。对我来说,这听起来更像是一个部署问题(缺少适用于实时站点的正确配置文件),而不是SSO问题。

您获得的生成的ID/令牌在某种程度上造成了问题,导致此错误的前三个原因是:1.更改域名,例如您在example.com上跳转到www.example.com,导致会话没有状态错误;2.从HTTP跳转到HTTPS或从HTTPS跳转到HTTP;3.会话未保存pRopPury,更多的请考虑一个多思想者:这是一个很好的回答。你应该把它作为一个答案,这样你就可以赚到赏金。如果它对你不起作用,安得烈,你介意把你的SP和IDP配置的元数据张贴吗?不看元数据很难给出具体的答案,但是我想P请指出Firefox有一个名为Saml Tracer()的附加组件,我在调试SSO问题时一直使用它。它可能会帮助您跟踪在不依赖调试语句的情况下来回发送的值。您好,我也遇到了同样的问题。您解决了这个问题吗?