protected function getOAuthTokenHeader($scopes) {
    if ($this->anonymous) {
      return [];
    }

    try {
      $token = AppIdentityService::getAccessToken($scopes);
      return ["Authorization" => sprintf(self::OAUTH_TOKEN_FORMAT,
                                         $token['access_token'])];
    } catch (AppIdentityException $e) {
      return false;
    }
  }
protected function getOAuthTokenHeader($scopes) {
    if ($this->anonymous) {
      return [];
    }

    try {
      $token = AppIdentityService::getAccessToken($scopes);
      return ["Authorization" => sprintf(self::OAUTH_TOKEN_FORMAT,
                                         $token['access_token'])];
    } catch (AppIdentityException $e) {
      return false;
    }
  }
protected function getOAuthTokenHeader ( $ scopes ) { if ( $ this -> anonymous ) { return [ ] ; } try { $ token = AppIdentityService :: getAccessToken ( $ scopes ) ; return [ "Authorization" => sprintf ( self :: OAUTH_TOKEN_FORMAT , $ token [ 'access_token' ] ) ] ; } catch ( AppIdentityException $ e ) { return false ; } }
Get the OAuth Token HTTP header for the supplied scope.

@param $scopes mixed The scopes to acquire the token for.

@return array The HTTP authorization header for the scopes, using the
applications service account. False if the call failed.
Get the OAuth Token HTTP header for the supplied scope .