NAME

Authen::GoogleAccount - Simple Authentication with Google Account

VERSION

Version 0.02

SYNOPSIS

# 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.

FUNCTIONS

new(key => $google_base_data_api_key)

Creates a new object. Requires Google Base data API Key. http://code.google.com/apis/base/signup.html

uri_to_login($next)

Creates a URI to login Google Account.

User will be redirected to $next with token after a successful login.

verify($token)

Verifies given token and returns true when the token is successfully verified.

name

Returns user name.

email

Returns user email("anon-~~~~@base.google.com"). It may be unique.

errstr

Returns error message.

delete_item

get_item

post_item

upgrade_to_session_token

revoke_session_token

init

AUTHOR

Hogeist, <mahito at cpan.org>, http://www.ornithopter.jp/

BUGS

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.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Authen::GoogleAccount

You can also look for information at:

COPYRIGHT & LICENSE

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.