The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Authen::GoogleAccount - Simple Authentication with Google Account

VERSION

Version 0.01

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 $q = CGI->new;
    my $ga = Authen::GoogleAccount->new;
    
    my $token = $q->param('token');
    
    $ga->verify($token) or die $ga->errstr;
    print "login succeeded\n";

FUNCTIONS

new

Creates a new object.

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 1 when the token is successfully verified.

errstr

Returns error message.

LIMITATIONS

This module cannot get any information(email, name, etc.) of Google Account for now. Please teach me the way of getting account information.

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.