line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyrights 2013-2019 by [Mark Overmeer ]. |
2
|
|
|
|
|
|
|
# For other contributors see ChangeLog. |
3
|
|
|
|
|
|
|
# See the manual pages for details on the licensing terms. |
4
|
|
|
|
|
|
|
# Pod stripped from pm file by OODoc 2.02. |
5
|
|
|
|
|
|
|
# This code is part of distribution Net-OAuth2. Meta-POD processed |
6
|
|
|
|
|
|
|
# with OODoc into POD and HTML manual-pages. See README.md |
7
|
|
|
|
|
|
|
# Copyright Mark Overmeer. Licensed under the same terms as Perl itself. |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package Net::OAuth2::Client; |
10
|
1
|
|
|
1
|
|
1334
|
use vars '$VERSION'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
48
|
|
11
|
|
|
|
|
|
|
$VERSION = '0.65'; |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
34
|
|
14
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
19
|
|
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
684
|
use LWP::UserAgent (); |
|
1
|
|
|
|
|
47680
|
|
|
1
|
|
|
|
|
24
|
|
17
|
1
|
|
|
1
|
|
7
|
use URI (); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
17
|
|
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
|
443
|
use Net::OAuth2::Profile::WebServer; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
20
|
1
|
|
|
1
|
|
373
|
use Net::OAuth2::Profile::Password; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
251
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub new($$@) |
24
|
0
|
|
|
0
|
1
|
|
{ my ($class, $id, $secret, %opts) = @_; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
$opts{client_id} = $id; |
27
|
0
|
|
|
|
|
|
$opts{client_secret} = $secret; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# auto-shared user-agent |
30
|
0
|
|
0
|
|
|
|
$opts{user_agent} ||= LWP::UserAgent->new; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
bless \%opts, $class; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
#---------------- |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
0
|
1
|
|
sub id() {shift->{NOC_id}} |
38
|
0
|
|
|
0
|
1
|
|
sub secret() {shift->{NOC_secret}} |
39
|
0
|
|
|
0
|
1
|
|
sub user_agent() {shift->{NOC_agent}} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
#---------------- |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub web_server(@) |
44
|
0
|
|
|
0
|
1
|
|
{ my $self = shift; |
45
|
0
|
|
|
|
|
|
Net::OAuth2::Profile::WebServer->new(%$self, @_); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub password(@) |
51
|
0
|
|
|
0
|
1
|
|
{ my $self = shift; |
52
|
0
|
|
|
|
|
|
Net::OAuth2::Profile::Password->new(%$self, @_); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |