The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Catalyst::Authentication::Credential::Testing

SYNOPSIS

    # Setup the auth in your config on your dev machines only
    __PACKAGE__->config(

        'Plugin::Authentication' => {
            default_realm => 'your_realm',
            realms        => {
                your_realm => {
                    credential => {
                        class           => 'Testing',
                        password_field  => 'password',
                        global_password => 'secret',  # password for all users
                    },
                },
            },
        },

    );

DESCRIPTION

When your developing an app it is often convenient to be able to log in as any user. You can either achieve this by disabling authentication (but then you can't test failed logins) or by setting all the passwords to be the same (which is annoying).

Or you can use this module and set one password for all users at the authentication level. This leaves the rest of your code untouched.

HOW IT WORKS

This module is based on Catalyst::Authentication::Credential::Password and overides the new and check_password methods.

new

Checks that the config is complete.

check_password

Returns true if the password is the same as that set in the config, false otherwise.

SEE ALSO

Catalyst::Authentication::Credential::Password

BUGS

Test suite is minimal.

AUTHOR

Edmund von der Burg <evdb@ecclestoad.co.uk>

Bug reports and suggestions very welcome.

ACKNOWLEDGMENTS

Developed whilst working at Foxtons - http://www.foxtons.co.uk. Thank you for letting me open source this code.

COPYRIGHT

Copyright (C) 2008 Edmund von der Burg. All rights reserved.

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

THERE IS NO WARRANTY.