You are here

public function Authentication::get_logout_link in Auth0 Single Sign On 8.2

Builds and returns a logout URL to terminate an SSO session.

@link https://auth0.com/docs/api/authentication#logout

Parameters

null|string $returnTo URL to return to after logging in; must be white-listed in Auth0.:

null|string $client_id Client ID to use Application-specific returnTo URLs.:

boolean $federated Attempt a federated logout.:

Return value

string

File

vendor/auth0/auth0-php/src/API/Authentication.php, line 239

Class

Authentication
Class Authentication

Namespace

Auth0\SDK\API

Code

public function get_logout_link($returnTo = null, $client_id = null, $federated = false) {
  $params = [];
  if ($returnTo !== null) {
    $params['returnTo'] = $returnTo;
  }
  if ($client_id !== null) {
    $params['client_id'] = $client_id;
  }
  if ($federated) {
    $params['federated'] = '';
  }
  return sprintf('https://%s/v2/logout?%s', $this->domain, Psr7\build_query($params));
}