Re: Defining scope as adsense.readonly still states 'view and manage' as rights ?

95 views
Skip to first unread message

Sérgio Gomes

unread,
Jul 11, 2012, 8:27:35 AM7/11/12
to adsen...@googlegroups.com
Hi Steffan,

I just tried the same thing, and it shows me:

View your AdSense data
     View your ad clients, ad units, and channels in AdSense
     View your AdSense performance and earnings reports

Are you sure you're not passing in the https://www.googleapis.com/auth/adsense scope as well?

Cheers,
Sérgio

---
Sérgio Gomes
Developer Relations

Google UK Limited
Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W 9TQ
Registered in England Number: 3977902


---
On Wednesday, July 11, 2012 8:00:47 AM UTC+1, Steffan Hoeke wrote:
I'm taking my first steps with the AdSense Management API in combination with the Google API Client and don't quite understand something...

I've set the scope to https://www.googleapis.com/auth/adsense.readonly but, the grant access screen says something else:
  • View and manage your AdSense data
    • View and manage your ad clients, ad units, and channels in AdSense
    • View your AdSense performance and earnings reports
    • Manage your AdSense URL blocks
  • Perform these operations when I'm not using the application

I would expect the bold parts not to be there, unless i specify something other than the readonly scope ?

Sérgio Gomes

unread,
Jul 13, 2012, 10:31:07 AM7/13/12
to adsen...@googlegroups.com
That's interesting... Any chance you can send me the logs of your auth requests, so that I can take a look at what's happening? Please send them to adsense...@google.com.

Cheers,
Sérgio

---
Sérgio Gomes
Developer Relations

Google UK Limited
Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W 9TQ
Registered in England Number: 3977902

---
On Wednesday, July 11, 2012 2:41:58 PM UTC+1, Steffan Hoeke wrote:
Sérgio,

I'm using 
$client->setScopes(
);
as per the google api client example to set the scope. 

I'm not (knowingly) setting the scope somewhere else...

Steffan Hoeke

unread,
Jul 16, 2012, 2:30:42 AM7/16/12
to adsen...@googlegroups.com
Sérgio,

No problem, can you point me in the direction of how to enable/configure logging ?

Steffan

Sérgio Gomes

unread,
Jul 16, 2012, 3:33:44 PM7/16/12
to adsen...@googlegroups.com
Hi Steffan,

You'll likely need to enable it at the PHP level:

ini_set('error_reporting', E_ALL);ini_set('display_errors', 1);

I'll see if I can get something a little bit more specific for debugging scope issues, though.

Cheers,
Sérgio

---
Sérgio Gomes
Developer Relations

Google UK Limited
Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W 9TQ
Registered in England Number: 3977902


---

Steffan Hoeke

unread,
Jul 17, 2012, 2:44:24 AM7/17/12
to adsen...@googlegroups.com
Sérgio,

I develop with those settings enabled :)

I don't see any reason why this would display anything though, as no errors are generated.
As far as the API client is concerned everything is functioning normally...

I quickly browsed through the api client code, but don't see any code for enabling debug output or logging of calls?

Steffan


On Monday, 16 July 2012 21:33:44 UTC+2, Sérgio Gomes wrote:
Hi Steffan,

Steffan Hoeke

unread,
Jul 17, 2012, 3:15:33 AM7/17/12
to adsen...@googlegroups.com
I just watched an authentication session using the Chrome developer tools, and noticed that the called URL does contain the correct scope parameter as specified by me:  &scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fadsense.readonly 

Once granted, is there a way to verify the type of access granted from the https://accounts.google.com/b/0/IssuedAuthSubTokens page ?


On Monday, 16 July 2012 21:33:44 UTC+2, Sérgio Gomes wrote:
Hi Steffan,

Sérgio Gomes

unread,
Jul 17, 2012, 12:08:29 PM7/17/12
to adsen...@googlegroups.com
Hi Steffan,

I'm afraid there isn't... The best I can think of is revoking your application and going through the OAuth 2.0 process again. Hopefully that will give you the right message next time.

Cheers,
Sérgio

---
Sérgio Gomes
Developer Relations

Google UK Limited
Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W 9TQ
Registered in England Number: 3977902


---

Steffan Hoeke

unread,
Jul 18, 2012, 1:34:31 AM7/18/12
to adsen...@googlegroups.com
Sérgio,

I've revoked access a dozen of times, no change in the scope though...

In an attempt to try and figure out what's causing this, I moved the scope definition to right after the place in the code where I also set $client->setRedirectURL(<url); and now I am getting the correct scope ! 

Probably a case of PEBKAC :P

Thanks for your support,
  Steffan
Reply all
Reply to author
Forward
0 new messages