andeedee / gapi-google-analytics-php-interface

Automatically exported from code.google.com/p/gapi-google-analytics-php-interface
0 stars 0 forks source link

AuthSub tokens do not work #31

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Pass an AuthSub session token to the gapi constructor
2. Try to access data from the API
3. Get an error

I fixed this problem by replacing:
protected function generateAuthHeader()
  {
    return array('Authorization: GoogleLogin auth=' . $this->auth_token);
  }

with 

protected function generateAuthHeader()
  {
    return array('Authorization: AuthSub token=' . $this->auth_token);
  }

because I am only using AuthSub tokens, but the best approach would
probably be to have an extra parameter in the constructor, specifying
whether the token (if passed) is ClientLogin or AuthSub. Then, the header
can be conditionally generated, and gapi will support AuthSub tokens as
well as ClientLogin ones. (However, getting the token is a seperate issue;
I've been using Zend_Gdata for that)

Original issue reported on code.google.com by yuri.kol...@gmail.com on 6 Jan 2010 at 10:33