Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Login failed at Google Spreadsheet API with Net::Google::Spreadsheets

I'm trying to read out (later maybe even write) into a Google Spreadsheet with Net::Google::Spreadsheets.

The most boilerplate script dies with "Login failed" and no error:

use Net::Google::Spreadsheets;

my $service = Net::Google::Spreadsheets->new(
  username => '[email protected]',
  password => 'mypassword'
);

All I'm getting is

Net::Google::AuthSub login failed

Sadly, I don't know how one would diagnose or fix this issue. Anyone?

Thanks so much!

like image 423
msallge Avatar asked Feb 10 '26 15:02

msallge


1 Answers

May be because of SSL certificate checking. You can skip the test with:

$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;

Though really you should set the certificate authorities correctly, as per the message returned by the Net::Google::AuthSub module:

Can't verify SSL peers without knowing which Certificate Authorities to trust

This problem can be fixed by either setting the PERL_LWP_SSL_CA_FILE envirionment variable or by installing the Mozilla::CA module.

To disable verification of SSL peers set the PERL_LWP_SSL_VERIFY_HOSTNAME envirionment variable to 0. If you do this you can't be sure that you communicate with the expected peer.

like image 171
gorlif Avatar answered Feb 17 '26 06:02

gorlif



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!