Amon2-Auth

 view release on metacpan or  search on metacpan

lib/Amon2/Auth/Site/Github.pm  view on Meta::CPAN

use strict;
use warnings;
use utf8;

package Amon2::Auth::Site::Github;
use Mouse;

use Amon2::Auth;
use LWP::UserAgent;
use JSON;
use Amon2::Auth::Util qw(parse_content);
our $VERSION = '0.07';

sub moniker { 'github' }

has client_id => (
	is => 'ro',
	isa => 'Str',
	required => 1,
);
has client_secret => (
	is => 'ro',
	isa => 'Str',
	required => 1,
);
has scope => (
	is => 'ro',
	isa => 'Str',
);

has user_info => (
    is => 'rw',
    isa => 'Bool',
    default => 1,
);

has ua => (
	is => 'ro',
	isa => 'LWP::UserAgent',
	lazy => 1,
	default => sub {
		my $ua = LWP::UserAgent->new(agent => "Amon2::Auth/$Amon2::Auth::VERSION");
	},
);

has authorize_url => (
	is => 'ro',
	isa => 'Str',
	default => 'https://github.com/login/oauth/authorize',
);
has access_token_url => (
	is => 'ro',
	isa => 'Str',
	default => 'https://github.com/login/oauth/access_token',
);
has redirect_url => (
	is => 'ro',
	isa => 'Str',
);

sub auth_uri {
    my ($self, $c, $callback_uri) = @_;



( run in 1.088 second using v1.01-cache-2.11-cpan-39bf76dae61 )