line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OAuth::Lite2::Server::GrantHandler::ServerState; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
2389
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
60
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
47
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
9
|
use parent 'OAuth::Lite2::Server::GrantHandler'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
13
|
|
7
|
2
|
|
|
2
|
|
77
|
use OAuth::Lite2::Server::Error; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
35
|
|
8
|
2
|
|
|
2
|
|
534
|
use OAuth::Lite2::ParamMethod::AuthHeader; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
43
|
|
9
|
2
|
|
|
2
|
|
11
|
use Carp (); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
332
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub is_required_client_authentication { |
12
|
0
|
|
|
0
|
1
|
0
|
return 0; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub handle_request { |
16
|
1
|
|
|
1
|
1
|
47
|
my ($self, $dh) = @_; |
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
|
|
7
|
my $req = $dh->request; |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
|
|
12
|
my $parser = OAuth::Lite2::ParamMethod::AuthHeader->new; |
21
|
1
|
|
|
|
|
5
|
my $header_credentials = $parser->basic_credentials($req); |
22
|
1
|
50
|
|
|
|
7
|
my $client_id = ($header_credentials->{client_id}) ? $header_credentials->{client_id} : $req->param("client_id"); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# create server_state |
25
|
1
|
|
|
|
|
192
|
my $server_state = $dh->create_server_state( |
26
|
|
|
|
|
|
|
client_id => $client_id, |
27
|
|
|
|
|
|
|
); |
28
|
1
|
50
|
33
|
|
|
28
|
Carp::croak "OAuth::Lite2::Server::DataHandler::create_server_state doesn't return OAuth::Lite2::Model::ServerState" |
29
|
|
|
|
|
|
|
unless ($server_state |
30
|
|
|
|
|
|
|
&& $server_state->isa("OAuth::Lite2::Model::ServerState")); |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
4
|
my $res = { |
33
|
|
|
|
|
|
|
server_state => $server_state->server_state, |
34
|
|
|
|
|
|
|
expires_in => $server_state->expires_in |
35
|
|
|
|
|
|
|
}; |
36
|
1
|
|
|
|
|
18
|
return $res; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 NAME |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
OAuth::Lite2::Server::GrantHandler::ServerState - handler for 'server_state' grant_type request |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 SYNOPSIS |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
my $handler = OAuth::Lite2::Server::GrantHandler::ServerState->new; |
46
|
|
|
|
|
|
|
my $res = $handler->handle_request( $data_handler ); |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 DESCRIPTION |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
handler for 'server_state' grant_type request. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 METHODS |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head2 handle_request( $req ) |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
See L document. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 AUTHOR |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Ryo Ito, Eritou.06@gmail.comE |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Lyo Kato, Elyo.kato@gmail.comE |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Copyright (C) 2010 by Lyo Kato |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
69
|
|
|
|
|
|
|
it under the same terms as Perl itself, either Perl version 5.8.8 or, |
70
|
|
|
|
|
|
|
at your option, any later version of Perl 5 you may have available. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
1; |