And*_*per 12 php saml simplesamlphp
我在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)
Run Code Online (Sandbox Code Playgroud)
我已经完成了页面要求我做的所有故障排除,但情况仍然存在.
我在浏览器上打开了开发工具并观看了cookie信息.biz.dev.originsystems.co.za的cookies包含一个SimpleAMLAuthToken,因此我认为cookie正在运行.我用来点击IdP的代码是:
$as = new SimpleSAML_Auth_Simple("stage-sso-sp");
$as->requireAuth();
$attributes = $as->getAttributes();
print_r($attributes);
Run Code Online (Sandbox Code Playgroud)
更新:
这里有更多信息......
我想确定问题是否与我如何设置IdP有关,所以我开始使用SSO Circle作为IdP.在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
Run Code Online (Sandbox Code Playgroud)
除SimpleSAMLAuthToken之外的所有内容都来自我们的应用程序,不应影响SimpleSAML.一旦我被重定向到SSO Circle并进行身份验证,我将返回到我的SimpleSAML页面,并且Auth Token现在具有值,_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]
Run Code Online (Sandbox Code Playgroud)
如果我转到https://biz.stage.originsystems.co.za?ccof=RGN002,我会被重定向,因为我希望在SSO Circle中进行身份验证.此时我的Autth Token的值为_39679e07cb1911e08b2bff3580a9929faddd07e9b6.一旦我通过身份验证,我就会被引导到SimpleSAML错误页面"State Information Lost"并且Auth Token仍然存在_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]
Run Code Online (Sandbox Code Playgroud)
它看起来好像Auth Token应该是_498e7d4d75bb7716e5e8cf905e0da5ef1c40cf1b3f但不是出于某种原因.由于SimpleSAML无法找到该Token,因此它永远不会删除旧的Token并创建一个新的Token.也许我错了.我非常愿意得到纠正.我的问题是我不知道造成这种情况的原因.我已将配置文件中的cookie.name设置为"biz.stage.originsystems.co.za",这似乎适用于SimpleSAML控制面板,但在使用实际应用程序中的SP时不起作用.有人能指出我在正确的方向吗?我迷路了.
您必须定义两个完全独立的环境,以便解决混合这两个环境(具有两个完全不同的身份提供商)的问题,正如您所描述的那样(这显然不起作用,除非将它们都添加到SSO 配置 - 这可能不是期望的结果);简单检查服务器的主机名并相应地定义变量 - 这可以“即时”完成,也可以通过两个不同的配置文件完成(实际上在部署结束时推送配置文件很常见)。对我来说,这听起来更像是部署问题(缺少实时站点的正确配置文件),而不是 SSO 问题。