Net-Google-DataAPI
view release on metacpan or search on metacpan
lib/Net/Google/DataAPI/Auth/ClientLogin/Multiple.pm view on Meta::CPAN
use Net::Google::AuthSub;
use Text::Glob;
with 'Net::Google::DataAPI::Role::Auth';
our $VERSION = '0.05';
has account_type => ( is => 'ro', isa => 'Str', required => 1, default => 'HOSTED_OR_GOOGLE' );
has source => ( is => 'ro', isa => 'Str', required => 1, default => __PACKAGE__ );
has username => ( is => 'ro', isa => 'Str', required => 1 );
has password => ( is => 'ro', isa => 'Str', required => 1 );
has services => ( is => 'ro', isa => 'HashRef', required => 1 );
has tokens => ( is => 'rw', isa => 'HashRef', default => sub { +{} });
sub sign_request {
my ($self, $req, $host) = @_;
$host ||= $req->uri->host;
$self->tokens->{$host} ||= $self->_get_auth_params($host);
$req->header(@{$self->tokens->{$host}});
return $req;
}
lib/Net/Google/DataAPI/Auth/OAuth.pm view on Meta::CPAN
access_token_secret
)) {
has $attr => (
is => 'rw',
isa => 'Str',
clearer => "clear_$attr",
predicate => "has_$attr"
);
}
has scope => ( is => 'ro', isa => 'ArrayRef[Str]', required => 1, auto_deref => 1 );
has callback => ( is => 'ro', isa => 'Net::Google::DataAPI::Types::URI', coerce => 1 );
has signature_method => ( is => 'ro', isa => 'Str', default => 'HMAC-SHA1' );
has authorize_token_hd => ( is => 'ro', isa => 'Str', default => 'default' );
has authorize_token_hl => ( is => 'ro', isa => 'Str', default => 'en' );
has mobile => ( is => 'ro', isa => 'Bool', default => 0 );
has ua => ( is => 'ro', isa => 'LWP::UserAgent', required => 1, lazy_build => 1 );
sub _build_ua {
LWP::UserAgent->new( max_redirect => 0 );
}
lib/Net/Google/DataAPI/Auth/OAuth2.pm view on Meta::CPAN
use Any::Moose;
use Net::Google::DataAPI::Types;
with 'Net::Google::DataAPI::Role::Auth';
use Net::OAuth2::Client;
use Net::OAuth2::Profile::WebServer;
use HTTP::Request::Common;
our $VERSION = '0.05';
has [qw(client_id client_secret)] => (is => 'ro', isa => 'Str', required => 1);
has redirect_uri => (is => 'ro', isa => 'Str', default => 'urn:ietf:wg:oauth:2.0:oob');
has scope => (is => 'ro', isa => 'ArrayRef[Str]', required => 1, auto_deref => 1,
default => sub {[
'https://www.googleapis.com/auth/userinfo.profile',
'https://www.googleapis.com/auth/userinfo.email'
]},
);
has state => (is => 'ro', isa => 'Str', default => '');
has site => (is => 'ro', isa => 'Str', default => 'https://accounts.google.com');
has authorize_path => (is => 'ro', isa => 'Str', default => '/o/oauth2/auth');
has access_token_path => (is => 'ro', isa => 'Str', default => '/o/oauth2/token');
has userinfo_url => (is => 'ro', isa => 'Str', default => 'https://www.googleapis.com/oauth2/v1/userinfo');
( run in 0.662 second using v1.01-cache-2.11-cpan-5f2e87ce722 )