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


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

the Authen::Simple manpage

the Authen::Simple::Password manpage

the Params::Validate manpage


AUTHOR

Christian Hansen ch@ngmedia.com


COPYRIGHT

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