Christian Hansen > Authen-Simple-0.5 > Authen::Simple::Adapter

Download:
Authen-Simple-0.5.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  2
View/Report Bugs
Source  

NAME ^

Authen::Simple::Adapter - Adapter class for implementations

SYNOPSIS ^

    package Authenticate::Simple::Larry;
    
    use strict;
    use base 'Authen::Simple::Adapter';
    
    __PACKAGE__->options({
        secret => {
            type     => Params::Validate::SCALAR,
            default  => 'wall',
            optional => 1
        }
    });
    
    sub check {
        my ( $self, $username, $password ) = @_;
        
        if ( $username eq 'larry' && $password eq $self->secret ) {
            
            $self->log->debug( qq/Successfully authenticated user '$username'./ )
              if $self->log;
            
            return 1;
        }
        
        $self->log->debug( qq/Failed to authenticate user '$username'. Reason: 'Invalid credentials'/ )
          if $self->log;
        
        return 0;
    }
    
    1;

DESCRIPTION ^

Adapter class for implementations.

METHODS ^

SEE ALSO ^

Authen::Simple

Authen::Simple::Password

Params::Validate

AUTHOR ^

Christian Hansen chansen@cpan.org

COPYRIGHT ^

This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: