summaryrefslogtreecommitdiffstats
path: root/lib/SimpleSAML/Auth/Source.php
diff options
context:
space:
mode:
authorJaime Perez Crespo <jaime.perez@uninett.no>2015-08-30 21:39:32 +0200
committerJaime Perez Crespo <jaime.perez@uninett.no>2015-08-30 21:39:32 +0200
commit634648072090faae743d1fe3cbf01a8d0b9f2775 (patch)
treeb70b173992e3562cae9d635020a0dcab6bd4494a /lib/SimpleSAML/Auth/Source.php
parent4e649e055ccb051e74ddfbf7bc439b5a3c457c76 (diff)
downloadsimplesamlphp-634648072090faae743d1fe3cbf01a8d0b9f2775.zip
simplesamlphp-634648072090faae743d1fe3cbf01a8d0b9f2775.tar.gz
simplesamlphp-634648072090faae743d1fe3cbf01a8d0b9f2775.tar.bz2
Move SimpleSAML_Auth_Default::initLogoutReturn() to SimpleSAML_Auth_Source and deprecate the former.
Diffstat (limited to 'lib/SimpleSAML/Auth/Source.php')
-rw-r--r--lib/SimpleSAML/Auth/Source.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/SimpleSAML/Auth/Source.php b/lib/SimpleSAML/Auth/Source.php
index 2ad82a7..fc3b9e8 100644
--- a/lib/SimpleSAML/Auth/Source.php
+++ b/lib/SimpleSAML/Auth/Source.php
@@ -248,6 +248,35 @@ abstract class SimpleSAML_Auth_Source
/**
+ * Start logout.
+ *
+ * This function starts a logout operation from the current authentication source. This function will return if the
+ * logout operation does not require a redirect.
+ *
+ * @param string $returnURL The URL we should redirect the user to after logging out. No checking is performed on
+ * the URL, so make sure to verify it on beforehand if the URL is obtained from user input. Refer to
+ * \SimpleSAML\Utils\HTTP::checkURLAllowed() for more information.
+ */
+ public function initLogoutReturn($returnURL)
+ {
+ assert('is_string($returnURL)');
+ assert('is_string($authority)');
+
+ $session = SimpleSAML_Session::getSessionFromRequest();
+
+ $state = $session->getAuthData($this->authId, 'LogoutState');
+ $session->doLogout($this->authId);
+
+ $state['SimpleSAML_Auth_Default.ReturnURL'] = $returnURL;
+ $state['LogoutCompletedHandler'] = array(get_class(), 'logoutCompleted');
+
+ $this->logout($state);
+
+ self::logoutCompleted($state);
+ }
+
+
+ /**
* Called when logout operation completes.
*
* This function never returns.