google spreadsheet API login woes

Steve Mynott steve.mynott at gmail.com
Thu Oct 16 18:28:38 BST 2014


On 16 October 2014 16:59, Simon Wistow <simon at thegestalt.org> wrote:
> On Thu, Oct 16, 2014 at 12:35:18PM +0100, Bob MacCallum said:
>> It's stopped working recently (can't say exactly when) - and I don't know
>> my AuthSub from my OAuth from my elbow.
>>
>> I've tried
>>
>>     my $auth = Net::Google::AuthSub->new;
>>     my $res  = $auth->login($user, $pass);
>
> I wrote Net::Google::AuthSub but I haven't used it for years and so it
> may be very, very out of date.

It didn't seem to work when I tried it a few weeks back despite
Google's claims of AuthSub being still supported until next year.
They probably changed something.  It's all very geared to their own
API libs not 3rd party ones for unsupported languages like Perl.
AuthSub is deprecated in favour of OAuth (which is pretty dreadful as
demonstrated by the YAPC::EU Oauth Dance).

I successfully accessed Google Calendar last month with a lot of
difficulty by doing the following:

Google::API::Client via  git clone
https://github.com/comewalk/google-api-perl-client.git

Used https://console.developers.google.com/project  (different to the
similarly named Google Play one!)

Note this does not work and doesn't give any warnings of not working
in a Firefox type browser I had to use Chrome.

I had to google several errors on stackoverflow (and noticed assorted
whines) to get the exact workflow in the dev console correct.

APIs & Auth>

1. Google Calender ON

2. Cred>Create new client ID> Installed Application

3. Also enter Email Address and minimal details in Consent Screen

$ cd google-api-perl-client/eg

edit "client_secrets.json" with your "client_id"

$ cd calendar

$ perl -I ../lib/ calendarlist.pl

Click on URI generated (I again had problems with Firefox and had to
use Chrome in order to copy and paste)

copy auth token back to command line

(this token is saved in the json and next time you run you aren't
prompted with url).

I was then able to access Google Calendar.

It's sure to time out and you probably have to refresh it.

I'd probably avoid Google Services after this experience unless I was
being paid to do it.  It's aimed at professional phone app devs not
hobbyist use.

I suspect it changes quite frequently too.

S


More information about the london.pm mailing list