Okay, so the solution to this is:
    use Dancer2;
    use Dancer2::Plugin::Auth::Tiny; # wrap route handlers with an authentication closure
    use Dancer2::Plugin::Database;   # provide the 'database' keyword for a simple DBI DB handle
    use Dancer2::Plugin::Auth::Extensible; # for login, password resets and roles
    use Dancer2::Plugin::Auth::Extensible::Provider::Database; # for login, password resets and roles
    # From Dancer2::Config: "If neither "PLACK_ENV" or "DANCER_ENVIRONMENT" is set, the environment defaults to development."
    set environment => 'development'; # Note: This informs which enviroments/xxx.yml file is used

    my $dpae = Dancer2::Plugin::Auth::Extensible::Provider::Database->new(
        plugin => app,
    );

However, the 'set environment' doesn't seem to work, so the script needs to be run as 'DANCER_ENVIRONMENT=development myscript.pl'
(otherwise none of the Dancer/DPAE settings are found)
-N

On 16 May 2017 at 16:42, Nathan Bailey <web@polynate.net> wrote:
Hi all,
 Separate but somewhat related to my previous questions - how can I make a command line script to do a change password, using the DPAE infrastructure?

Presumably I will need to use Dancer2? Or can I dig directly into DPAE's set_user_password()?

Dancer2::Plugin::Auth::Extensible::Provider::Database->new() wants a 'plugin', and Dancer2::Plugin::Auth::Extensible->new() wants an 'app'; I could pass fake values in but I suspect that's going to break things. How far up the tree do I need to go to be able to say "Use XXX", "XXX->new" and "XXX...->set_user_password"?

thanks,
Nathan