Only OAuth as authentication?

58 views
Skip to first unread message

saverio mucci

unread,
Dec 6, 2011, 12:24:52 PM12/6/11
to adsen...@googlegroups.com
Hi all, 
Is the OAuth the only way to access the api because i just want to use them to send some kind of scheduled e-mail.
I tried something like this: 

        service = build("adsense", "v1", developerKey=KEY)
        service.adclients().list().execute()

from:
but i get a "login required" as response, am I doing something wrong ?

Thanks 
Saverio

Sérgio Gomes

unread,
Dec 6, 2011, 1:26:50 PM12/6/11
to adsen...@googlegroups.com
Hi Saverio,

Yes, OAuth is currently the only supported method of authentication.

It does have facilities for automated access, however. If you follow the auth flow at least once, you'll get back a "refresh token". This is a long-lived token that you can use to generate access tokens automatically, without requiring user input again. It will only ever expire if the user revokes access to the application.

Our client library guide might be able to help (take a look at the "Persisting authentication data" section). If not, let me know what programming language you're using (and whether you're using our client libraries), and I'll help you figure out how to persist that data.

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

saverio mucci

unread,
Dec 8, 2011, 2:57:20 AM12/8/11
to adsen...@googlegroups.com
Hi Sérgio,
good to know that is not going to expire, apparently my first test
ended up with a bad experience given from the fact that in the api
console i specified web application instead of standalone, this means
wrong redirect url error and headache to understand what I was doing
wrong from the code point of view.
Change the type of application was enough to fix all my problems :).

Cheers,
Saverio

2011/12/6 Sérgio Gomes <sergio...@google.com>:

> --
> You received this message because you are subscribed to the Google Groups
> "AdSense API Forum" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/adsense-api/-/E9ilSa9lkq8J.
>
> To post to this group, send email to adsen...@googlegroups.com.
> To unsubscribe from this group, send email to
> adsense-api...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/adsense-api?hl=en.

Reply all
Reply to author
Forward
0 new messages