我在https://biz.dev.originsystems.co.za上设置了一个服务提供商。我在http://stage.originsystems.co.za上设置了一个IdP。
在https://biz.dev.originsystems.co.za/simplesaml/module.php/core/authenticate.php上使用该工具测试身份验证时,一切工作正常。它带着所需的属性返回到Dev站点,一切都是愉快和快乐的。
但是,当我尝试在https://biz.dev.originsystems.co.za上实际点击代码中的IdP时,我被重定向到阶段日志页面,但在登录后,我得到了一个“状态信息丢失”错误。我得到了以下调试信息:
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包含一个SimpleAMLAuthToken,所以我认为cookies可以正常工作。我用来访问IdP的代码是:
$as = new SimpleSAML_Auth_Simple("stage-sso-sp");
$as->requireAuth();
$attributes = $as->getAttributes();
print_r($attributes);更新:
这里有一些更多的信息。
我想确定问题是否出在我设置IdP的方式上,所以我开始为IdP使用SSO Circle。在SSO Circle上进行身份验证后,状态信息也会丢失。我认为这意味着问题出在我的SimpleSAML服务提供商设置的某个地方。事情是这样的.
当我转到https://biz.stage.originsystems.co.za/simplesaml上的SimpleSAML测试身份验证源页面时,我有以下Cookie值...
Name Value
SimpleSAMLAuthToken _a53569c0701dd02832532df14cf10cd0b2d9fcd6b6
biz.stage.originsystems.co.za 10fc356e0bfbf707af5fa5854c378755
ccof RGN002
xbrF 84aadc624fc51c0c9340d45645c08643除了SimpleSAMLAuthToken之外的所有内容都来自我们的应用程序,不应该影响SimpleSAML。一旦我被重定向到SSO Circle并通过身份验证,我就会返回到我的SimpleSAML页面,Auth令牌现在的值是_39679e07cb1911e08b2bff3580a9929faddd07e9b6,并且所有相关信息都被正确返回。日志文件显示以下活动。
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]如果我转到https://biz.stage.originsystems.co.za?ccof=RGN002,我会像我期望的那样被重定向到SSO Circle,然后在那里进行身份验证。此时,我的Autth令牌的值为_39679e07cb1911e08b2bff3580a9929faddd07e9b6。一旦我通过了身份验证,我就会被定向到一个SimpleSAML错误页面"State Information Lost“,而Auth令牌仍然是_39679e07cb1911e08b2bff3580a9929faddd07e9b6。
日志是这样写的:
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]在我看来,Auth令牌应该是_498e7d4d75bb7716e5e8cf905e0da5ef1c40cf1b3f,但由于某种原因,它并不是。由于SimpleSAML找不到该令牌,因此它不会删除旧令牌并创建新令牌。也许我错了。我非常愿意被纠正。我的问题是,我不知道是什么导致了这种情况。我已经在配置文件中将cookie.name设置为"biz.stage.originsystems.co.za“,这对于SimpleSAML控制面板似乎工作得很好,但在实际应用程序中使用SP时却不起作用。有人能给我指出正确的方向吗?我迷路了。
发布于 2018-01-26 18:38:47
您必须定义两个完全独立的环境,以便解决您所描述的混合这两个环境(以两个完全不同的身份提供者为特征)的问题(这显然不起作用,除非将这两个环境都添加到SSO配置中--这可能不是预期的结果);简单地检查服务器的主机名并相应地定义变量-这可以“即时”完成,也可以由两个不同的配置文件完成(实际上,在部署结束时推送配置文件是非常常见的)。对我来说,这听起来更像是部署问题(缺少活动站点的正确配置文件),而不是SSO问题。
https://stackoverflow.com/questions/35055541
复制相似问题