You are here

public function gapiOAuth2::generateAuthHeader in Google Analytics Statistics 7.2

Generate authorization token header for all requests

Parameters

String $token:

Return value

Array

File

includes/gapi.class.php, line 660

Class

gapiOAuth2
OAuth2 Google API authentication

Code

public function generateAuthHeader($token = null) {
  if ($token == null) {
    $token = $this->auth_token;
  }
  return array(
    'Authorization' => 'Bearer ' . $token,
  );
}