You are here

function oauth2_client_authorized in OAuth2 Client 7

Same name and namespace in other branches
  1. 7.2 oauth2_client.module \oauth2_client_authorized()

Callback for path oauth2/authorized.

An authorized request in server-side flow will be redirected here (having variables 'code' and 'state').

1 string reference to 'oauth2_client_authorized'
oauth2_client_menu in ./oauth2_client.module
Implements hook_menu().

File

./oauth2_client.module, line 69
Provides OAuth2 client functionality.

Code

function oauth2_client_authorized() {

  // If there is any error in the server response, display it.
  if (isset($_GET['error'])) {
    $error = $_GET['error'];
    $error_description = $_GET['error_description'];
    drupal_set_message("Error: {$error}: {$error_description}", 'error');
  }

  // Redirect to the client that started the authentication.
  OAuth2\Client::redirect($clean = FALSE);
}