Catalyst-Authentication-Credential-Crowd

 view release on metacpan or  search on metacpan

META.yml  view on Meta::CPAN

configure_requires:
  ExtUtils::MakeMaker: 6.30
dynamic_config: 0
generated_by: 'Dist::Zilla version 5.012, CPAN::Meta::Converter version 2.133380'
license: perl
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: 1.4
name: Catalyst-Authentication-Credential-Crowd
requires:
  HTTP::Request: 0
  JSON: 0
  LWP::UserAgent: 0
  Moose: 0
  strict: 0
  warnings: 0
version: 0.07

Makefile.PL  view on Meta::CPAN

  "AUTHOR" => "Keerati Thiwanruk <keerati.th\@gmail.com>",
  "BUILD_REQUIRES" => {},
  "CONFIGURE_REQUIRES" => {
    "ExtUtils::MakeMaker" => "6.30"
  },
  "DISTNAME" => "Catalyst-Authentication-Credential-Crowd",
  "EXE_FILES" => [],
  "LICENSE" => "perl",
  "NAME" => "Catalyst::Authentication::Credential::Crowd",
  "PREREQ_PM" => {
    "HTTP::Request" => 0,
    "JSON" => 0,
    "LWP::UserAgent" => 0,
    "Moose" => 0,
    "strict" => 0,
    "warnings" => 0
  },
  "TEST_REQUIRES" => {
    "Catalyst" => 0,
    "Catalyst::Controller" => 0,
    "Catalyst::Plugin::Authentication" => 0,

Makefile.PL  view on Meta::CPAN

    "TESTS" => "t/*.t"
  }
);


my %FallbackPrereqs = (
  "Catalyst" => 0,
  "Catalyst::Controller" => 0,
  "Catalyst::Plugin::Authentication" => 0,
  "FindBin" => 0,
  "HTTP::Request" => 0,
  "JSON" => 0,
  "LWP::UserAgent" => 0,
  "Moose" => 0,
  "Test::Fake::HTTPD" => 0,
  "Test::More" => 0,
  "Test::TCP" => 0,
  "Test::WWW::Mechanize::Catalyst" => 0,
  "lib" => 0,
  "namespace::autoclean" => 0,
  "strict" => 0,

lib/Catalyst/Authentication/Credential/Crowd.pm  view on Meta::CPAN

package Catalyst::Authentication::Credential::Crowd;

use strict;
use warnings;

our $VERSION = '0.07';

use Moose;
use HTTP::Request;
use LWP::UserAgent;
use JSON;

has 'authen_url' => (
    is => 'ro',
    isa => 'Str',
    required => '1',
    default => sub { 'http://localhost'; }
);

lib/Catalyst/Authentication/Credential/Crowd.pm  view on Meta::CPAN

    return;

}

sub _crowd_authen {
    my ( $self, $username, $password ) = @_;
    my $ua = LWP::UserAgent->new;
    my $uri = $self->authen_url."?username=$username";
    my $json_hash = { value => $password };
    my $json = to_json( $json_hash );
    my $req = HTTP::Request->new( 'POST',  $uri );
    $req->authorization_basic(
        $self->app->{app_name},
        $self->app->{password}
    );
    $req->header('Accept' => 'application/json');
    $req->header('Content-Type' => 'application/json');
    $req->content( $json );

    my $response = $ua->request( $req );
    return $response;



( run in 0.460 second using v1.01-cache-2.11-cpan-de7293f3b23 )