SimpleSAMLPHP NoState错误
我设置了两个simplesamlphp服务器,它们都位于同一个物理服务器上,但由virtualhost分隔。他们目前在域中SimpleSAMLPHP NoState错误,php,simplesamlphp,Php,Simplesamlphp,我设置了两个simplesamlphp服务器,它们都位于同一个物理服务器上,但由virtualhost分隔。他们目前在域中 id.saml.domain.com您可以尝试更改config.php中的session store.type。您可以在服务提供商或身份提供商中执行此操作。从某种意义上说,这两种方法具有不同的会话存储。对我有用 $lib = "/ltsites/saml/service/lib"; $sp = "default-sp"; // Name of SP def
id.saml.domain.com
您可以尝试更改config.php中的session store.type。您可以在服务提供商或身份提供商中执行此操作。从某种意义上说,这两种方法具有不同的会话存储。对我有用
$lib = "/ltsites/saml/service/lib";
$sp = "default-sp"; // Name of SP defined in config/authsources.php
try {
// Autoload simplesamlphp classes.
if(!file_exists("{$lib}/_autoload.php")) {
throw(new Exception("simpleSAMLphp lib loader file does not exist: ".
"{$lib}/_autoload.php"));
}
include_once("{$lib}/_autoload.php");
$as = new SimpleSAML_Auth_Simple($sp);
// Take the user to IdP and authenticate.
$as->requireAuth();
$valid_saml_session = $as->isAuthenticated();
} catch (Exception $e) {
// SimpleSAMLphp is not configured correctly.
throw(new Exception("SSO authentication failed: ". $e->getMessage()));
return;
}
if (!$valid_saml_session) {
// Not valid session. Redirect a user to Identity Provider
try {
$as = new SimpleSAML_Auth_Simple($sp);
$as->requireAuth();
} catch (Exception $e) {
// SimpleSAMLphp is not configured correctly.
throw(new Exception("SSO authentication failed: ". $e->getMessage()));
return;
}
}
// At this point, the user is authenticated by the Identity Provider, and has access
// to the attributes received with SAML assertion.
$attributes = $as->getAttributes();
State information lost
SimpleSAML_Error_NoState: NOSTATE