You are here

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

Builds and returns the authorization URL.

@link https://auth0.com/docs/api/authentication#authorize-application

Parameters

string $response_type Response type requested, typically "code" for web application login.:

string $redirect_uri Redirect URI for login and consent, must be white-listed.:

null|string $connection Connection parameter to send with the request.:

null|string $state State parameter to send with the request.:

array $additional_params Additional URL parameters to send with the request.:

Return value

string

File

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

Class

Authentication
Class Authentication

Namespace

Auth0\SDK\API

Code

public function get_authorize_link($response_type, $redirect_uri, $connection = null, $state = null, array $additional_params = []) {
  $additional_params['response_type'] = $response_type;
  $additional_params['redirect_uri'] = $redirect_uri;
  $additional_params['client_id'] = $this->client_id;
  if ($connection !== null) {
    $additional_params['connection'] = $connection;
  }
  if ($state !== null) {
    $additional_params['state'] = $state;
  }
  return sprintf('https://%s/authorize?%s', $this->domain, Psr7\build_query($additional_params));
}