Net::Google::AuthSub::Once - Make one secure authenticated request to a Google service
my $auth = Net::Google::AuthSub::Once->new(); redirect_to($auth->get_authorization_url('http://example.com/your-next-url')); # Then after the response comes back # Make a request to the Google service my $auth = Net::Google::AuthSub::Once->new({ private_key_filename => 'filename' }); my $request = HTTP::Request->new(GET => 'http://www.google.com/...'); $auth->sign_request($request); my $resp = $ua->request($request);
The nice thing about this module is that you don't need to know the Google login details of the user of your applications. You can make a secure request to a Google service in their place.
You must add your domain on Google for using secure requests. This module only supports secure requests. https://www.google.com/accounts/ManageDomains
Google has some information about create the private key file you need.
http://code.google.com/apis/gdata/docs/auth/authsub.html#Registered
private_key_filename
The filename of a private key file.
Returns the authorization url that you need to redirect to. Next_url is the url that google will redirect you to after the request was authorized.
Signs the HTTP::Request.
Peter Stuifzand <peter@stuifzand.eu>
Copyright, 2010 - Peter Stuifzand
Released under the same terms as Perl itself
To install Net::Google::AuthSub::Once, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Google::AuthSub::Once
CPAN shell
perl -MCPAN -e shell install Net::Google::AuthSub::Once
For more information on module installation, please visit the detailed CPAN module installation guide.