You are here

protected function OpenIDConnectClientBase::getUrlOptions in OpenID Connect / OAuth client 8

Same name and namespace in other branches
  1. 2.x src/Plugin/OpenIDConnectClientBase.php \Drupal\openid_connect\Plugin\OpenIDConnectClientBase::getUrlOptions()

Helper function for URL options.

Parameters

string $scope: A string of scopes.

\Drupal\Core\GeneratedUrl $redirect_uri: URI to redirect for authorization.

Return value

array Array with URL options.

1 call to OpenIDConnectClientBase::getUrlOptions()
OpenIDConnectClientBase::authorize in src/Plugin/OpenIDConnectClientBase.php
Redirects the user to the authorization endpoint.

File

src/Plugin/OpenIDConnectClientBase.php, line 285

Class

OpenIDConnectClientBase
Base class for OpenID Connect client plugins.

Namespace

Drupal\openid_connect\Plugin

Code

protected function getUrlOptions($scope, GeneratedUrl $redirect_uri) {
  return [
    'query' => [
      'client_id' => $this->configuration['client_id'],
      'response_type' => 'code',
      'scope' => $scope,
      'redirect_uri' => $redirect_uri
        ->getGeneratedUrl(),
      'state' => $this->stateToken
        ->create(),
    ],
  ];
}