-
Notifications
You must be signed in to change notification settings - Fork 0
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
example logout not working #30
Comments
tentative patch: diff --git a/example/logout.php b/example/logout.php
index 293c6ad..3d11223 100644
--- a/example/logout.php
+++ b/example/logout.php
@@ -5,9 +5,4 @@ require_once(__DIR__ . "/settings.php");
$sp = new Italia\Spid2\Sp($settings);
-if ($sp->isAuthenticated()) {
- $sp->logout();
-} else {
- echo "Logged out!";
- echo '<p><a href="index.php" >Go back</a></p>';
-}
+$sp->logout();
diff --git a/src/Strategy/SpOneLogin.php b/src/Strategy/SpOneLogin.php
index 958bd4d..5695a21 100644
--- a/src/Strategy/SpOneLogin.php
+++ b/src/Strategy/SpOneLogin.php
@@ -162,11 +162,9 @@ class SpOneLogin implements SpInterface
public function logout()
{
- if ($this->auth->isAuthenticated() === false) {
- return false;
+ if (isset($_SESSION) && isset($_SESSION['idpName'])) {
+ $this->changeIdp($_SESSION['idpName']);
}
- $this->auth->logout();
-
$sloBuiltUrl = $this->auth->logout(null, array(), null, null, true);
$_SESSION['LogoutRequestID'] = $this->auth->getLastRequestID(); but then you hit: #2 (comment) |
fixing that with #2 (comment) you get
what is missing here is the processing of the SLO response ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
click "logout", no
LogoutRequest
is sent !cause:
$sp->isAuthenticated
returns false because there is noResponse
in the headers so it skips the line$sp->logout()
this check also occurs in the SpOneLogin.php implementation !
The text was updated successfully, but these errors were encountered: