simpleSamlPHP isAuthenticated始终返回false

时间:2020-10-08 23:41:02

标签: php single-sign-on saml simplesamlphp

我刚刚开始使用simplesamlPHP开发。我安装了simpleSamlPhp,并按照https://simplesamlphp.org/docs/development/simplesamlphp-sp-api中给出的步骤将php应用程序与simpleSAMLPhp集成在一起,并且我正在使用文档中提供的simpleSaml API。

下面是代码:

require_once('/var/simplesamlphp/lib/_autoload.php');
$auth = new \SimpleSAML\Auth\Simple('default-sp');
if($auth->isAuthenticated()){
  $attributes = $auth->getAttributes();
}else{
  echo "Not authenticated";
  $auth->requireAuth();
}

$ auth-> isAuthenticated()始终返回false。我还需要做其他事情吗?还是我错过了什么?

0 个答案:

没有答案