[dancer-users] Dancer2::Plugin::Auth::Extensible problem - likely me
John Stoffel
john at stoffel.org
Fri Dec 4 21:37:06 GMT 2015
I'm trying to play with Authentication in Dancer2, and I can't get the
dang example from Gabor at his blog
(http://perlmaven.com/password-protecting-web-pages-in-dancer2) to
run, it keeps giving me the following error:
No Auth::Extensible realms configured with which to authenticate user
at /home/stoffj/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Dancer2/Plugin/Auth/Extensible.pm
line 1160. HTTP::Server::PSGI: Accepting connections at http://0:5000/
And I'm going a little crazy. I'm using a perlbrew interpretter on
CentOS 6.7, runnning perl 5.14.2, with all the latest modules
installed.
>From looking at the Extensible.pm file, it's warning from the
on_plugin_import() sub where it's looking for Realms.
I've got the following config.yml file setup:
show_errors: 1
session: "YAML"
logger: console
log: core
plugins:
Auth::Extensible:
realms:
config:
provider: Config
users:
- user: 'foo'
pass: 'bar'
name: 'George Foo'
roles:
- Marketing
- user: 'bar'
pass: 'foo'
name: 'George Bar'
roles:
- Testing
- Marketing
- Management
And my app.pl looks like this:
#!perl
#
use strict;
use Dancer2;
use Dancer2::Plugin::Auth::Extensible;
get '/' => sub {
return 'This is a public page. Everyone can see it. Check out the <a
href="/report">report</a>';
};
get '/report' => require_role Marketing => sub {
return 'Only authenticated users should be able to see this page';
};
dance;
And I'm invoking it like this:
~/tmp/Dancer2> ../../perl5/perlbrew/perls/perl-5.14.2/bin/plackup -R . app.pl
Watching . ./lib app.pl for file updates.
No Auth::Extensible realms configured with which to authenticate user at /home/stoffj/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Dancer2/Plugin/Auth/Extensible.pm line 1160.
HTTP::Server::PSGI: Accepting connections at http://0:5000/
So does anyone see what I'm going wrong here?
Thanks,
John
More information about the dancer-users
mailing list