Subject: | Fetching list of calendars fails with 'Authorization required' even after successful login() call |
I'm hitting a problem with failed authorisation when trying to fetch a
list of calendars, even after a (seemingly successful) login() call.
An excerpt from my code:
my $calendar = Net::Google::Calendar->new;
say "Logging in as " . $config->{username};
$calendar->login(@$config{qw(username password)})
or die "Failed to log in to Google Calendar";
say "Looking for calendars..";
# Find and select the Squash calendar:
say "Calendars: " . join ';', map { $_->title } $calendar->get_calendars;
The call to $calendar->get_calendars fails, with:
401 Authorization required at
/usr/local/share/perl/5.10.0/Net/Google/Calendar.pm line 577.
This code worked perfectly before, but has recently stopped working,
some time in the last few days (it's something that I only run
periodically, so I can't pinpoint exactly when).
Two things have happened around this time:
* the machine it's on is a fresh Debian install - previously it was an
old Slackware setup. This is quite probably the reason for the change.
* Google released changes to their API:
http://code.google.com/apis/calendar/changelog.html
The changelog does not mention anything which seems pertinent.
Through the debugger, I see that $self->{user} is being set correctly;
looking at the code, login() should only do that if it's happy that the
login succeeded.
So - as far as I can tell, the login succeeded and all was well, but an
attempt to fetch a list of calendars now fails.
Just wondered if you'd experienced or heard of any similar problems,
before I go digging through everything to figure out what's happening?