The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

OAuth2::Google::Plus

DESCRIPTION

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.

SYNOPSYS

    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 );
authorization_uri

Construct an URI object for authorization. This url should be use to provide a login button to the user

authorize ( authorization_code => $code )

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.