File Coverage

blib/lib/Mojolicious/Plugin/Web/Auth/Site/LinkedIn.pm
Criterion Covered Total %
statement 9 10 90.0
branch n/a
condition n/a
subroutine 3 4 75.0
pod 0 1 0.0
total 12 15 80.0


line stmt bran cond sub pod time code
1 1     1   1075 use strict;
  1         2  
  1         45  
2 1     1   7 use warnings;
  1         2  
  1         117  
3              
4             package Mojolicious::Plugin::Web::Auth::Site::LinkedIn;
5             $Mojolicious::Plugin::Web::Auth::Site::LinkedIn::VERSION = '0.03';
6 1     1   806 use Mojo::Base qw/Mojolicious::Plugin::Web::Auth::OAuth2/;
  1         10002  
  1         7  
7              
8             has access_token_url => 'https://www.linkedin.com/oauth/v2/accessToken';
9             has authorize_url => 'https://www.linkedin.com/oauth/v2/authorization';
10             has response_type => 'code';
11             has user_info => 1;
12             has user_info_url => 'https://api.linkedin.com/v1/people/~:(id,email-address,first-name,last-name,formatted-name,headline,summary,positions,picture-url,specialties,num-connections,api-standard-profile-request)?format=json';
13             has authorize_header => 'Bearer';
14              
15 0     0 0   sub moniker {'linkedin'}
16              
17             1;
18              
19             =pod
20              
21             =encoding UTF-8
22              
23             =head1 NAME
24              
25             Mojolicious::Plugin::Web::Auth::Site::LinkedIn - LinkedIn OAuth Plugin for Mojolicious::Plugin::Web::Auth
26              
27             =head1 VERSION
28              
29             version 0.03
30              
31             =head1 SYNOPSIS
32              
33             # Mojolicious
34             $self->plugin('Web::Auth',
35             module => 'LinkedIn',
36             key => 'LinkedIn consumer key',
37             secret => 'LinkedIn consumer secret',
38             on_finished => sub {
39             my ( $c, $access_token, $user_info ) = @_;
40             ...
41             },
42             on_error => sub {
43             my ( $c, $error ) = @_;
44             ...
45             },
46             );
47              
48             # Mojolicious::Lite
49             plugin 'Web::Auth',
50             module => 'LinkedIn',
51             key => 'LinkedIn consumer key',
52             secret => 'LinkedIn consumer secret',
53             on_finished => sub {
54             my ( $c, $access_token, $user_info ) = @_;
55             ...
56             };
57              
58              
59             # default authentication endpoint: /auth/linkedin/authenticate
60             # default callback endpoint: /auth/linkedin/callback
61              
62             =head1 DESCRIPTION
63              
64             This module adds L support to
65             L.
66              
67             =head1 AUTHOR
68              
69             Vikas N Kumar
70              
71             =head1 COPYRIGHT AND LICENSE
72              
73             This software is copyright (c) 2016 by Vikas N Kumar.
74              
75             This is free software; you can redistribute it and/or modify it under
76             the same terms as the Perl 5 programming language system itself.
77              
78             =cut
79              
80             __END__