Log out not working using $ad->forget();
avaiyahardik opened this issue · 4 comments
avaiyahardik commented
Log out not working using $ad->forget();
kschroeder commented
More information needed
avaiyahardik commented
first I am authenticating as below
require_once __DIR__ . '/../../vendor/autoload.php';
session_start();
$config = [
'authentication' => [
'ad' => [
'client_id' => 'MY_CLIENT_ID',
'client_secret' => 'MY_CLIENT_SECRET',
'enabled' => '1',
'directory' => '',
'return_url'=>'MY_REDIRECT_URL'
]
]
];
$request = new \Zend\Http\PhpEnvironment\Request();
$ad = new \Magium\ActiveDirectory\ActiveDirectory(
new \Magium\Configuration\Config\Repository\ArrayConfigurationRepository($config),
Zend\Psr7Bridge\Psr7ServerRequest::fromZend(new \Zend\Http\PhpEnvironment\Request())
);
$entity = $ad->authenticate();
Then in logout function call, I am using global variable $ad as $ad->forget(); which is not loggin out the session from office 365 for my php application
kschroeder commented
Ahh. The forget()
method only clears the session locally. I think the information at https://hajekj.net/2017/02/27/to-single-sign-out-or-not-to/ might help sign off remotely. I did not want to implement a behavior that restricts the behavior of the application to a particular workflow so forget()
only clears the authentication locally.
avaiyahardik commented
Thank you. It worked!