EveOnline-SSO
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/EveOnline/SSO.pm view on Meta::CPAN
=encoding utf-8
=head1 NAME
EveOnline::SSO - Module for Single Sign On in EveOnline API-services.
=head1 SYNOPSIS
use EveOnline::SSO;
my $sso = EveOnline::SSO->new(client_id => '03ed7324fe4f455', client_secret => 'bgHejXdYo0YJf9NnYs');
# return url for open in browser
print $sso->get_code();
# or
print $sso->get_code(state => 'some_ids_or_flags');
# or
print $sso->get_code(state => 'some_ids_or_flags', scope=>'esi-calendar.respond_calendar_events.v1 esi-location.read_location.v1');
# return hash with access and refresh tokens by auth code
print Dumper $sso->get_token(code=>'tCaVozogf45ttk-Fb71DeEFcSYJXnCHjhGy');
# or hash with access and refresh tokens by refresh_token
print Dumper $sso->get_token(refresh_token=>'berF1ZVu_bkt2ud1JzuqmjFkpafSkobqdso');
# return hash with access and refresh tokens through listening light web-server
print Dumper $sso->get_token_through_webserver(
scope=>'esi-calendar.respond_calendar_events.v1 esi-location.read_location.v1',
state=> 'Awesome'
);
=head1 DESCRIPTION
EveOnline::SSO is a perl module for get auth in https://eveonline.com through Single Sign-On (OAuth) interface.
=cut
package EveOnline::SSO;
use 5.008001;
use utf8;
use Modern::Perl;
use JSON::XS;
use URI::Escape;
use MIME::Base64;
use URI::URL;
use LWP::UserAgent;
use LWP::Socket;
use Moo;
our $VERSION = "0.03";
has 'ua' => (
is => 'ro',
default => sub {
my $ua = LWP::UserAgent->new();
$ua->agent( 'EveOnline::SSO Perl Client' );
$ua->timeout( 120 );
return $ua;
}
);
has 'auth_url' => (
is => 'ro',
default => 'https://login.eveonline.com/oauth/authorize/',
);
has 'token_url' => (
is => 'ro',
default => 'https://login.eveonline.com/oauth/token',
);
has 'callback_url' => (
is => 'rw',
default => 'http://localhost:10707/',
);
has 'client_id' => (
is => 'rw',
required => 1,
);
has 'client_secret' => (
is => 'rw',
required => 1,
);
has 'demo' => (
is => 'rw'
);
=head1 CONSTRUCTOR
=over
=item B<new()>
Require two arguments: client_id and client_secret.
view all matches for this distributionview release on metacpan - search on metacpan
( run in 1.504 second using v1.00-cache-2.02-grep-82fe00e-cpan-f5108d614456 )