blib/lib/Net/OAuth2/Profile/Password.pm untested

filter: Statementstmt 0.0% 0 / 30 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 43 CC 1 SCAR 6.9
CC
1
Cov
0%
init
2.0
get_access_token
2.0
BEGIN
2.0
CRAP 2.0
1 # Copyrights 2013-2019 by [Mark Overmeer <markov@cpan.org>].
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 use vars '$VERSION';
11 $VERSION = '0.65';
12  
13 use base 'Net::OAuth2::Profile';
14  
15 use warnings;
16 use strict;
17  
18 use URI;
19 use Net::OAuth2::AccessToken;
20 use HTTP::Request;
21  
22  
23 sub init($)
24 { my ($self, $args) = @_;
25 $args->{grant_type} ||= 'password';
26 $self->SUPER::init($args);
27 $self;
28 }
29  
30 #-------------------
31  
32 #--------------------
33  
34  
35 sub get_access_token(@)
36 { my $self = shift;
37  
38 my $request = $self->build_request
39 ( $self->access_token_method
40 , $self->access_token_url
41 , $self->access_token_params(@_)
42 );
43  
44 my $response = $self->request($request);
45  
46 Net::OAuth2::AccessToken->new(client => $self
47 , $self->params_from_response($response, 'access token'));
48 }
49  
50 1;