OAuth2::Google::Plus
This is an implementation of the google OAuth2 API. It's a rather specific implementation of this specific OAuth2 provider. Small implementation details differ per provider, this module attempts to abstract and document the Google version.
use OAuth2::Google::Plus; my $plus = OAuth2::Google::Plus->new( client_id => 'CLIENT ID', client_secret => 'CLIENT SECRET', redirect_uri => 'http://my.app.com/authorize', ); # generate the link for signup my $uri = $plus->authorization_uri( redirect_url => $url_string ) # callback returns with a code in url my $access_token = $plus->authorize( $request->param('code') ); # store $access_token somewhere safe... # use $authorization_token my $info = OAuth2::Google::Plus::UserInfo->new( access_token => $access_token );
Construct an URI object for authorization. This url should be use to provide a login button to the user
Use an authorization_token to retrieve an access_token from google. This access token can be used to retrieve information about the user who authorized.
To install OAuth2::Google::Plus, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OAuth2::Google::Plus
CPAN shell
perl -MCPAN -e shell install OAuth2::Google::Plus
For more information on module installation, please visit the detailed CPAN module installation guide.