有没有人可以分享一下如何从simplesamlphp注销的代码?
<?php
session_start();
require_once('/var/www/usage-tracker/simplesamlphp/lib/_autoload.php');
$as = new SimpleSAML_Auth_Simple('wso2-sp');
$as->requireAuth();
$auth_dataArray=$as-> getAuthDataArray ();
$auth_data=$as-> getAuthData();
$name=$as-> getAuthData("saml:sp:NameID");
$name['Value'];
$username=$name['Value'];
$_SESSION['username']=$username;
include 'ldap_groups.php';这是我的索引页,认证后会重定向到另一个索引页,该过程后如何注销?
发布于 2016-04-29 16:46:19
下面是一段可以使用的代码:
$URL_AFTER_LOGOUT = "/";
header("Location: ".$as->getLogoutURL($URL_AFTER_LOGOUT));希望这会对某些人有所帮助。
发布于 2018-12-19 22:08:41
在docs/simplesamlphp-sp-api.md的末尾:您可以轻松地创建自己的链接,而无需使用此函数(getLogoutURL)。URL应为:
.../simplesaml/module.php/core/as_logout.php?AuthId=<authentication source>&ReturnTo=<return URL>
例如:
.../simplesaml/module.php/core/as_logout.php?AuthId=default-sp&ReturnTo=/user
发布于 2016-12-22 14:04:59
只需重定向到注销URL
例如: Zend框架
if($as->isAuthenticated()){
return $this->redirect()->toUrl($as->getLogoutURL());
}https://stackoverflow.com/questions/35935153
复制相似问题