Scroll to navigation

Mojolicious::Plugin::BasicAuth(3pm) User Contributed Perl Documentation Mojolicious::Plugin::BasicAuth(3pm)

NAME

Mojolicious::Plugin::BasicAuth - Basic HTTP Auth Helper

DESCRIPTION

Mojolicous::Plugin::BasicAuth is a helper for basic http authentication.

USAGE

    use Mojolicious::Lite;
    plugin 'basic_auth';
    get '/' => sub {
        my $self = shift;
        return $self->render_text('ok')
          if $self->basic_auth(
                  realm => sub { return 1 if "@_" eq 'username password' }
          );
    };
    app->start;

METHODS

Mojolicious::Plugin::BasicAuth inherits all methods from Mojolicious::Plugin and implements the following new ones.

"register"

    $plugin->register;

Register condition in Mojolicious application.

SEE ALSO

Mojolicious

DEVELOPMENT

<http://github.com/tempire/mojolicious-plugin-basicauth>

VERSION

0.06

CREDITS

AUTHOR

Glen Hinkle tempire@cpan.org

2022-06-15 perl v5.34.0