File Coverage

blib/lib/OpenID/Lite/Extension/UI.pm
Criterion Covered Total %
statement 21 21 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod n/a
total 28 28 100.0


line stmt bran cond sub pod time code
1             package OpenID::Lite::Extension::UI;
2              
3 1     1   5 use strict;
  1         2  
  1         53  
4 1     1   5 use warnings;
  1         1  
  1         28  
5 1     1   5 use base 'Exporter';
  1         2  
  1         138  
6              
7             our $VERSION = '0.01';
8             our @EXPORT_OK = qw(UI_NS UI_POPUP_NS UI_LANG_NS UI_NS_ALIAS);
9              
10 1     1   5 use constant UI_NS => q{http://specs.openid.net/extensions/ui/1.0};
  1         1  
  1         86  
11 1     1   5 use constant UI_POPUP_NS => q{http://specs.openid.net/extensions/ui/1.0/popup};
  1         2  
  1         48  
12 1     1   5 use constant UI_LANG_NS => q{http://specs.openid.net/extensions/ui/1.0/lang-pref};
  1         1  
  1         37  
13 1     1   5 use constant UI_NS_ALIAS => q{ui};
  1         1  
  1         130  
14              
15             1;
16              
17             =head1 NAME
18              
19             OpenID::Lite::Extension::UI - UI extension plugin for OpenID::Lite
20              
21             =head1 SYNOPSIS
22              
23             RP side
24              
25             sub login {
26             ...
27             my $checkid_req = $rp->begin( $identifier )
28             or $your_app->error( $rp->errstr );
29              
30             $ui_req = OpenID::Lite::Extension::UI->new;
31             $ui_req->mode('popup');
32             $ui_req->lang('en-US');
33             $checkid_req->add_extension( $ui_req );
34              
35             $your_app->redirect_to( $checkid_req->redirect_url( ... ) );
36             }
37              
38             OP side
39              
40             my $res = $op->handle_request( $your_app->request );
41              
42             if ( $res->is_for_setup ) {
43              
44             my %option;
45             my $ui_req = OpenID::Lite::Extension::UI::Request->from_provider_response($res);
46             if ($ui_req) {
47             if ($ui_req->mode eq 'popup') {
48             $option{template} = 'openid_popup.tt';
49             }
50             }
51             $your_app->render( %option );
52             }...
53              
54             =head1 DESCRIPTION
55              
56             This module is plugin for OpenID::Lite to acomplish UI extension flow on easy way.
57             http://wiki.openid.net/f/openid_ui_extension_draft01.html
58              
59             =head1 SEE ALSO
60              
61             L
62              
63             L
64             L
65              
66             =head1 AUTHOR
67              
68             Lyo Kato, Elyo.kato@gmail.comE
69              
70             =head1 COPYRIGHT AND LICENSE
71              
72             Copyright (C) 2009 by Lyo Kato
73              
74             This library is free software; you can redistribute it and/or modify
75             it under the same terms as Perl itself, either Perl version 5.8.8 or,
76             at your option, any later version of Perl 5 you may have available.
77              
78              
79             =cut