chandantul has asked for the wisdom of the Perl Monks concerning the following question:
Hello Smart Monks, I will need your help in AD authentication configuration in app.psgi file. I was able to conifugure simple authentication but not able to configure AD authentication. Please check my below code that is not not leeting me start the app.psgi.
# use this block if you don't need middleware, and only have a single +target Dancer app to run here use webapp; use Plack::Builder; use Authen::Simple::ActiveDirectory; my $ad = Authen::Simple::ActiveDirectory->new( host => 'ldaps//ADDEV.dev.abc.com', principal => 'abc.com' ); builder { enable "Auth::Basic", authenticator => $ad; webapp->to_app; }; my($username, $password, $env) = @_; if ( $ad->authenticate( $username, $password ) ) { # successfull authentication } else { die "Wrong ID and Password\n" }
Please check below error and help me to identify the issue if possible
:Simple::ActiveDirectory::authenticate was an 'undef', which is not on +e of the allowed types: scalar at C:/Strawberry/perl/site/lib/Authen/Simple/Adapter.pm line 42, <DAT +A> line 755. Authen::Simple::Adapter::authenticate(undef, undef, undef) cal +led at C:\Users\Documents\Perl\webapp\bin\app.psgi line 26 require C:\Users\Documents\Perl\webapp\bin\app.psgi called at +(eval 6) line 3 eval 'package Plack::Sandbox::C_3a_5cUsers_5c503004671_5cDocum +ents_5cPerl_5cSynchrony_2dPerl_5cwebapp_5cbin_5capp_2epsgi; { my $app = do $_file; if ( !$app && ( my $error = $@ || $! )) { die $error; } $app; } ' called at C:/Strawberry/perl/site/lib/Plack/Util.pm line 120 Plack::Util::_load_sandbox("C:\\Users\\Documents\\Perl\\webapp +\\bin\\a"...) called at C:/Strawberry/perl/site/lib/Plack/Util.pm lin +e 136 Plack::Util::load_psgi("app.psgi") called at C:/Strawberry/per +l/site/lib/Plack/Runner.pm line 181 Plack::Runner::__ANON__() called at C:/Strawberry/perl/site/li +b/Plack/Runner.pm line 24 Plack::Runner::__ANON__() called at C:/Strawberry/perl/site/li +b/Plack/Runner.pm line 24 Plack::Runner::__ANON__() called at C:/Strawberry/perl/site/li +b/Plack/Runner.pm line 24 Plack::Runner::__ANON__() called at C:/Strawberry/perl/site/li +b/Plack/Runner.pm line 24 Plack::Runner::__ANON__() called at C:/Strawberry/perl/site/li +b/Plack/Loader.pm line 55 Plack::Loader::preload_app(Plack::Loader=HASH(0x65aa50), CODE( +0x2ca34c0)) called at C:/Strawberry/perl/site/lib/Plack/Runner.pm lin +e 276 Plack::Runner::run(Plack::Runner=HASH(0x11aa248)) called at C: +\Strawberry\perl\site\bin/plackup line 7
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Need advice on AD authentication confirguration in Dancer2 app.
by 1nickt (Canon) on May 11, 2021 at 10:46 UTC | |
by chandantul (Scribe) on May 12, 2021 at 03:26 UTC |