Commit 2c754ad33b5b0444b1bb7cbcfc5363344ac5f03b

Authored by Mhd Salahuddin Al Arif
1 parent 21e3db6176
Exists in master

add ssoLogout

Showing 2 changed files with 16 additions and 0 deletions Side-by-side Diff

... ... @@ -39,4 +39,10 @@
39 39 }
40 40  
41 41 ```
  42 +
  43 +```$php
  44 +$url_back = {return_url};
  45 +$objSso = new SsoClientLibrary();
  46 +$objSso->ssoLogout($url_back);
  47 +```
src/SsoClientLibrary.php
... ... @@ -125,5 +125,15 @@
125 125 die('Something went wrong, please trace back your action!');
126 126 }
127 127  
  128 + public function ssoLogout($url_back = '') {
  129 + $query = http_build_query([
  130 + 'url_back' => $url_back,
  131 + ]);
  132 +
  133 + $_url = $this->targetUri ."sso/logout?" . $query;
  134 + header("Location: " . $_url);
  135 + die();
  136 + }
  137 +
128 138 }