magium/active-directory

Log out not working using $ad->forget();

avaiyahardik opened this issue · 4 comments

Log out not working using $ad->forget();

More information needed

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

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.

Thank you. It worked!