BTrey has asked for the wisdom of the Perl Monks concerning the following question:

I'm creating a site with Dancer2 and adding authentication. I've created a simple form page to create user accounts but am getting an error when I try to call the create_user function:

post '/adduser' => sub { create_user username=>param{'Username'}; user_password username => param{'Username'}, password => param{'Pa +ssword'}; };

This results in a 500 error:

Can't locate object method "create_user" via package "Dancer2::Plugin::Auth::Extensible::Provider::Database" at /usr/local/share/perl/5.14.2/Dancer2/Plugin/Auth/Extensible.pm line 696.

This simple test page:
get '/admin' => require_role admin => sub { return 'You found the admin page!'; };

opens up the built-in "Login Required" page, so the auth module is installed and functioning.

Looking at the Extensible module, the code that errors out is:

my $user = $provider->create_user(%options);

So it looks to me as if the provider module should implement the function, and that seems to be back up by the error message. But checking the modules,none of them do:

Provider# ls Base.pm Config.pm Database.pm Example.pm Unix.pm Provider# grep create_user * Provider# grep sub * Base.pm:sub new { Base.pm:sub realm_settings { shift->{realm_settings} || {} } Base.pm:sub realm_dsl { shift->{dsl} } Base.pm:sub match_password { Base.pm:sub encrypt_password { Base.pm: *$method = sub { Config.pm:sub authenticate_user { Config.pm:sub get_user_details { Config.pm:sub get_user_roles { Database.pm:sub authenticate_user { Database.pm:sub get_user_details { Database.pm:sub get_user_roles { Example.pm:sub users { Example.pm:sub authenticate_user { Example.pm:sub get_user_details { Example.pm:sub get_user_roles { Unix.pm:sub authenticate_user { Unix.pm:sub get_user_details { Unix.pm:sub get_user_roles {
Any help greatly appreciated.

Replies are listed 'Best First'.
Re: Dancer2 Extensible Auth create_user
by Anonymous Monk on Jan 31, 2016 at 10:40 UTC

    *snippets* ... Any help greatly appreciated.

    So, report the missing feature, or implement it?

      I can certainly do that. The reason I raised the question is that Auth Extensible is a reasonably well known and, I assume, widely used extension. I find all sorts of references to using it, including basic tutorials to implement it, etc. I can't find any reference on CPAN or from just scouring the web to it missing key functions like that. Searching for the specific error turns up nothing. Since none of the various providers seem to include that function, my first assumption was that I needed to install another plugin which provided the functionality but I've turned up nothing in that regard either. It strikes me as odd that a well-known module would be that incomplete with no mention of it. I'm more of a perl blunderer with aspirations than a true perl hacker, so I posted here to make sure I wasn't missing something before submitting a bug report for a non-existent bug.