Google Authentication using perl cgi-application

I created CGI :: The application currently running on the local host and used two authentication methods -
1. described in http://www.perlmonks.org/?node_id=622071 , storing the user password in the database and
2. using LDAP credentials.

I was looking for an easy way to do Google authentication, but have not yet found an easy way. Can someone point me in the right direction.

I looked 1. Authen-GoogleAccount and
2. net-Google-FederatedLogin

but not enough documentation for any of them. Where to begin? Please let me know, even if you have a pointer to doing this outside of cgi :: application

+3
source share
2 answers

This is the closest solution I could find. I am not a security expert, but I do not think sites that are seriously related to this will use this method. It uses WWW :: Mechanize to authenticate using Google email / password, and then retrieves the protected content.

http://gregjessup.com/login-to-google-using-perl/

if $ mech-> get ($ url); returns an error, authentication failed.

0
source

Here is the code I used for Android Market for Developers (market.android.com/publish):

use WWW::Mechanize;
use HTTP::Cookies;

my $url = 'https://www.google.com/accounts/ServiceLogin';
my $username = 'username@gmail.com';                                                          
my $password = "PASSWORD";
my $mech = WWW::Mechanize->new();
$mech->cookie_jar(HTTP::Cookies->new());
$mech->get($url);
$mech->form_number(1);
$mech->field(Email => $username);
$mech->field(Passwd => $password);
$mech->click();
# Go to the next link, now that we are logged in.                                                                                   
$url = 'https://market.android.com/publish/Home';
$mech->get($url);
print $mech->content();

/ Prateek: http://gregjessup.com/login-to-google-using-perl. , Google, , .

0

Source: https://habr.com/ru/post/1778998/


All Articles