| 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 |  | 11000 | use vars '$VERSION'; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 51 |  | 
| 11 |  |  |  |  |  |  | $VERSION = '0.66'; | 
| 12 |  |  |  |  |  |  |  | 
| 13 | 1 |  |  | 1 |  | 5 | use warnings; | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 32 |  | 
| 14 | 1 |  |  | 1 |  | 6 | use strict; | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 20 |  | 
| 15 |  |  |  |  |  |  |  | 
| 16 | 1 |  |  | 1 |  | 617 | use LWP::UserAgent (); | 
|  | 1 |  |  |  |  | 40491 |  | 
|  | 1 |  |  |  |  | 22 |  | 
| 17 | 1 |  |  | 1 |  | 7 | use URI            (); | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 14 |  | 
| 18 |  |  |  |  |  |  |  | 
| 19 | 1 |  |  | 1 |  | 423 | use Net::OAuth2::Profile::WebServer; | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 32 |  | 
| 20 | 1 |  |  | 1 |  | 375 | use Net::OAuth2::Profile::Password; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 155 |  | 
| 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; |