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   628 use strict;
  1         1  
  1         26  
2 1     1   6 use warnings;
  1         2  
  1         47  
3              
4             package Mojolicious::Plugin::Web::Auth::Site::LinkedIn;
5             $Mojolicious::Plugin::Web::Auth::Site::LinkedIn::VERSION = '0.04';
6 1     1   411 use Mojo::Base qw/Mojolicious::Plugin::Web::Auth::OAuth2/;
  1         157983  
  1         9  
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 scope => 'r_liteprofile r_emailaddress';
12             has user_info => 1;
13             has user_info_url => 'https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~))';
14             has authorize_header => 'Bearer';
15              
16 0     0 0   sub moniker {'linkedin'}
17              
18             1;
19              
20             =pod
21              
22             =encoding UTF-8
23              
24             =head1 NAME
25              
26             Mojolicious::Plugin::Web::Auth::Site::LinkedIn - LinkedIn OAuth Plugin for Mojolicious::Plugin::Web::Auth
27              
28             =head1 VERSION
29              
30             version 0.04
31              
32             =head1 SYNOPSIS
33              
34             # Mojolicious
35             $self->plugin('Web::Auth',
36             module => 'LinkedIn',
37             key => 'LinkedIn consumer key',
38             secret => 'LinkedIn consumer secret',
39             on_finished => sub {
40             my ( $c, $access_token, $email_info ) = @_;
41             ...
42             },
43             on_error => sub {
44             my ( $c, $error ) = @_;
45             ...
46             },
47             );
48              
49             # Mojolicious::Lite
50             plugin 'Web::Auth',
51             module => 'LinkedIn',
52             key => 'LinkedIn consumer key',
53             secret => 'LinkedIn consumer secret',
54             on_finished => sub {
55             my ( $c, $access_token, $email_info ) = @_;
56             ...
57             };
58              
59              
60             # default authentication endpoint: /auth/linkedin/authenticate
61             # default callback endpoint: /auth/linkedin/callback
62              
63             =head1 DESCRIPTION
64              
65             This module adds L support to
66             L.
67              
68             =head1 AUTHOR
69              
70             Vikas N Kumar
71              
72             =head1 COPYRIGHT AND LICENSE
73              
74             This software is copyright (c) 2019 by Vikas N Kumar.
75              
76             This is free software; you can redistribute it and/or modify it under
77             the same terms as the Perl 5 programming language system itself.
78              
79             =cut
80              
81             __END__