Authen::GoogleAccount - Simple Authentication with Google Account
Version 0.02
# step 1 # redirect to goole to get token use CGI; use Authen::GoogleAccount; my $q = CGI->new; my $ga = Authen::GoogleAccount->new; # set callback url to verify token my $next = "http://www.example.com/googleauth.cgi"; my $uri_to_login = $ga->uri_to_login($next); print $q->redirect($uri_to_login); # step 2 # user will be redirected to http://www.example.com/googleauth.cgi?token=(token) # get token with CGI.pm and give it to verify() use CGI; use Authen::GoogleAccount; my $google_base_data_api_key = "fwioe2fqwoajieqawerq123ae..."; my $q = CGI->new; my $ga = Authen::GoogleAccount->new( key => $google_base_data_api_key, ); my $token = $q->param('token'); $ga->verify($token) or die $ga->errstr; print "login succeeded\n"; print $ga->name, " ", $ga->email, "\n"; #"email" may be unique.
Creates a new object. Requires Google Base data API Key. http://code.google.com/apis/base/signup.html
Creates a URI to login Google Account.
User will be redirected to $next with token after a successful login.
Verifies given token and returns true when the token is successfully verified.
Returns user name.
Returns user email("anon-~~~~@base.google.com"). It may be unique.
Returns error message.
Hogeist, <mahito at cpan.org>, http://www.ornithopter.jp/
<mahito at cpan.org>
Please report any bugs or feature requests to bug-authen-googleaccount at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Authen-GoogleAccount. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-authen-googleaccount at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Authen::GoogleAccount
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Authen-GoogleAccount
CPAN Ratings
http://cpanratings.perl.org/d/Authen-GoogleAccount
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Authen-GoogleAccount
Search CPAN
http://search.cpan.org/dist/Authen-GoogleAccount
Copyright 2007 Hogeist, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Authen::GoogleAccount, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Authen::GoogleAccount
CPAN shell
perl -MCPAN -e shell install Authen::GoogleAccount
For more information on module installation, please visit the detailed CPAN module installation guide.