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

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.