in reply to Need advice on AD authentication confirguration in Dancer2 app.

Hi,

This:

my($username, $password, $env) = @_; if ( $ad->authenticate( $username, $password ) ) {
led to this:
Authen::Simple::Adapter::authenticate(undef, undef, undef) called at C +:\Users\Documents\Perl\webapp\bin\app.psgi

So what do you think could be wrong? How can you check that you are making the authenticate() call with the right parameters?

Hope this helps!


The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^2: Need advice on AD authentication confirguration in Dancer2 app.
by chandantul (Scribe) on May 12, 2021 at 03:26 UTC

    Hello, I made the authentication works for AD for this Dacer2 app by the below code but i would like to add the logout option post authentication. How i can achive the same> Please advice with code snippet if possible.

    use webapp; use Plack::Builder; use Authen::Simple::ActiveDirectory; use Log::Log4perl; my $ad = Authen::Simple::ActiveDirectory->new( host => 'ldap://addev.dev.abc.com', principal => 'addev.dev.abc.com', timeout => '60', log => Log::Log4perl->get_logger('Authen::Simple::ActiveDirectory' +) ); builder { enable "Auth::Basic", authenticator => $ad; my ( $username, $password ) = @_; webapp->to_app; };