You are here

protected function AuthController::buildAuthorizeUrl in Auth0 Single Sign On 8

Same name and namespace in other branches
  1. 8.2 src/Controller/AuthController.php \Drupal\auth0\Controller\AuthController::buildAuthorizeUrl()

Build the Authorize url

Parameters

$prompt none|login if prompt=none should be passed, false if not:

2 calls to AuthController::buildAuthorizeUrl()
AuthController::callback in src/Controller/AuthController.php
Handles the callback for the oauth transaction.
AuthController::login in src/Controller/AuthController.php
Handles the login page override.

File

src/Controller/AuthController.php, line 169

Class

AuthController
Controller routines for auth0 authentication.

Namespace

Drupal\auth0\Controller

Code

protected function buildAuthorizeUrl($prompt) {
  global $base_root;
  $auth0Api = new Authentication($this->domain, $this->client_id);
  $response_type = 'code';
  $redirect_uri = "{$base_root}/auth0/callback";
  $connection = null;
  $state = $this
    ->getNonce();
  $additional_params = [];
  $additional_params['scope'] = 'openid profile email';
  if ($prompt) {
    $additional_params['prompt'] = $prompt;
  }
  return $auth0Api
    ->get_authorize_link($response_type, $redirect_uri, $connection, $state, $additional_params);
}