You are here

public function Auth0::login in Auth0 Single Sign On 8.2

Redirect to the hosted login page for a specific client

Parameters

null $state - state value.:

null $connection - connection to use.:

array $additionalParams - additional, valid parameters.:

Return value

void

See also

\Auth0\SDK\API\Authentication::get_authorize_link()

https://auth0.com/docs/api/authentication#login

File

vendor/auth0/auth0-php/src/Auth0.php, line 412

Class

Auth0
Class Auth0 Provides access to Auth0 authentication functionality.

Namespace

Auth0\SDK

Code

public function login($state = null, $connection = null, array $additionalParams = []) {
  $params = [];
  if ($state) {
    $params['state'] = $state;
  }
  if ($connection) {
    $params['connection'] = $connection;
  }
  if (!empty($additionalParams) && is_array($additionalParams)) {
    $params = array_replace($params, $additionalParams);
  }
  $login_url = $this
    ->getLoginUrl($params);
  header('Location: ' . $login_url);
  exit;
}