You are here

public static function Client::setRedirect in OAuth2 Client 7.2

Same name and namespace in other branches
  1. 7 oauth2_client.inc \OAuth2\Client::setRedirect()

Save the information needed for redirection after getting the token.

3 calls to Client::setRedirect()
Client::getAuthenticationUrl in src/Client.php
Return the authentication url (used in case of the server-side flow).
oauth2_client_set_redirect in ./oauth2_client.module
Set a redirect request.
oauth2_client_set_redirect in ./oauth2_client.api.php
Set a redirect request.

File

src/Client.php, line 379
Class OAuth2\Client.

Class

Client
The class OAuth2\Client is used to communicate with an oauth2 server.

Namespace

OAuth2

Code

public static function setRedirect($state, $redirect = NULL) {
  if (is_null($redirect)) {
    $redirect = array(
      'uri' => $_GET['q'],
      'params' => drupal_get_query_parameters(),
      'client' => 'oauth2_client',
    );
  }
  if (!isset($redirect['client'])) {
    $redirect['client'] = 'external';
  }
  $_SESSION['oauth2_client']['redirect'][$state] = $redirect;
}