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::Profile::Password; |
10
|
1
|
|
|
1
|
|
5
|
use vars '$VERSION'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
11
|
|
|
|
|
|
|
$VERSION = '0.66'; |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
5
|
use base 'Net::OAuth2::Profile'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
122
|
|
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
29
|
|
16
|
1
|
|
|
1
|
|
3
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
24
|
|
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
4
|
use URI; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
18
|
|
19
|
1
|
|
|
1
|
|
4
|
use Net::OAuth2::AccessToken; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
20
|
1
|
|
|
1
|
|
4
|
use HTTP::Request; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
140
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub init($) |
24
|
0
|
|
|
0
|
0
|
|
{ my ($self, $args) = @_; |
25
|
0
|
|
0
|
|
|
|
$args->{grant_type} ||= 'password'; |
26
|
0
|
|
|
|
|
|
$self->SUPER::init($args); |
27
|
0
|
|
|
|
|
|
$self; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
#------------------- |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
#-------------------- |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub get_access_token(@) |
36
|
0
|
|
|
0
|
1
|
|
{ my $self = shift; |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
my $request = $self->build_request |
39
|
|
|
|
|
|
|
( $self->access_token_method |
40
|
|
|
|
|
|
|
, $self->access_token_url |
41
|
|
|
|
|
|
|
, $self->access_token_params(@_) |
42
|
|
|
|
|
|
|
); |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
my $response = $self->request($request); |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
Net::OAuth2::AccessToken->new(client => $self |
47
|
|
|
|
|
|
|
, $self->params_from_response($response, 'access token')); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |