Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDP Custom Logout #1816

Open
On5-Repos opened this issue Jun 20, 2023 · 0 comments
Open

IDP Custom Logout #1816

On5-Repos opened this issue Jun 20, 2023 · 0 comments

Comments

@On5-Repos
Copy link

Describe the bug
IDP logout (custom) as per defined in documentation.

$as = new Simple('myauthinstance');
$as->logout([
'ReturnTo' => 'xxxxxxxxxxxx',
'ReturnStateParam' => 'LogoutState',
'ReturnStateStage' => 'MyLogoutState'
]);
Session::getSessionFromRequest()->cleanup();

Redirect happens as per configuration but when user manually sent a call. (SP is bookmarked) IDP still consider the user is logged in and Responds back to SP request with a SAML token.

Log file shows the following:
Jun 20 09:46:37 saml DEBUG [6efd4c9e77] Session: 'myauthinstance' not valid because we are not authenticated.
Jun 20 09:46:37 saml DEBUG [6efd4c9e77] Saved state: '_a29e3b12ad9fd35ec16aabf882d916b865f89b3323'
Jun 20 09:46:37 saml DEBUG [6efd4c9e77] Session: 'myauthinstance' not valid because we are not authenticated.

To Reproduce (create custom route)
public function customLogout(Request $request)
{

if ($this->config->getBoolean('enable.saml20-idp') === false || !Module::isModuleEnabled('saml')) {
  throw new Error\Error('NOACCESS', null, 403);
}

$as = new Simple('myauthinstance');
$as->requireAuth();
$as->logout([
  'ReturnTo' => 'xxxxxxxxxxx',
  'ReturnStateParam' => 'LogoutState',
  'ReturnStateStage' => 'MyLogoutState'
]);
Session::getSessionFromRequest()->cleanup();

}

After login just browse to URL ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant