File Coverage

blib/lib/Authen/SASL/Perl/LOGIN.pm
Criterion Covered Total %
statement 14 15 93.3
branch 4 4 100.0
condition n/a
subroutine 7 7 100.0
pod 0 3 0.0
total 25 29 86.2


line stmt bran cond sub pod time code
1             # Copyright (c) 2002 Graham Barr <gbarr@pobox.com>. All rights reserved.
2             # This program is free software; you can redistribute it and/or
3             # modify it under the same terms as Perl itself.
4              
5             package Authen::SASL::Perl::LOGIN;
6              
7 2     2   27 use strict;
  2         18  
  2         54  
8 2     2   31 use vars qw($VERSION @ISA);
  2         18  
  2         31  
9              
10             $VERSION = "1.03";
11             @ISA = qw(Authen::SASL::Perl);
12              
13             my %secflags = (
14             noanonymous => 1,
15             );
16              
17 37     37   387 sub _order { 1 }
18             sub _secflags {
19 15     15   135   shift;
20 15         211   scalar grep { $secflags{$_} } @_;
  0         0  
21             }
22              
23 2     2 0 26 sub mechanism { 'LOGIN' }
24              
25             sub client_start {
26 1     1 0 10   my $self = shift;
27 1         13   '';
28             }
29              
30             sub client_step {
31 3     3 0 30   my ($self, $string) = @_;
32              
33 3 100       60   $string =~ /password/i
    100          
34                 ? $self->_call('pass')
35                 : $string =~ /username/i
36                   ? $self->_call('user')
37                   : '';
38             }
39              
40             1;
41              
42             __END__
43            
44             =head1 NAME
45            
46             Authen::SASL::Perl::LOGIN - Login Authentication class
47            
48             =head1 SYNOPSIS
49            
50             use Authen::SASL qw(Perl);
51            
52             $sasl = Authen::SASL->new(
53             mechanism => 'LOGIN',
54             callback => {
55             user => $user,
56             pass => $pass
57             },
58             );
59            
60             =head1 DESCRIPTION
61            
62             This method implements the client part of the LOGIN SASL algorithm,
63             as described in IETF Draft draft-murchison-sasl-login-00.txt from August 2003.
64            
65             =head2 CALLBACK
66            
67             The callbacks used are:
68            
69             =over 4
70            
71             =item user
72            
73             The username to be used for authentication
74            
75             =item pass
76            
77             The user's password to be used for authentication
78            
79             =back
80            
81             =head1 SEE ALSO
82            
83             L<Authen::SASL>,
84             L<Authen::SASL::Perl>
85            
86             =head1 AUTHORS
87            
88             Software written by Graham Barr <gbarr@pobox.com>,
89             documentation written by Peter Marschall <peter@adpm.de>.
90            
91             Please report any bugs, or post any suggestions, to the perl-ldap mailing list
92             <perl-ldap@perl.org>
93            
94             =head1 COPYRIGHT
95            
96             Copyright (c) 2002-2004 Graham Barr.
97             All rights reserved. This program is free software; you can redistribute
98             it and/or modify it under the same terms as Perl itself.
99            
100             Documentation Copyright (c) 2004 Peter Marschall.
101             All rights reserved. This documentation is distributed,
102             and may be redistributed, under the same terms as Perl itself.
103            
104             =cut
105