----------------------------------------------------------------------- successful ldapsearch from command line (returns 264 entries) ldapsearch -h xxx.xxx.xxx.xxx -D "cn=Test User,ou=user,ou=accounts,ou=our,dc=our,dc=domain,dc=com" -W -b "dc=our,dc=domain,dc=com" objectclass=person ----------------------------------------------------------------------- # config.yml: plugins: Auth::Extensible: realms: config1: provider: LDAP host: xxx.xxx.xxx.xxx basedn: dc=our,dc=domain,dc=com binddn: 'cn=Test User,OU=USER,OU=ACCOUNTS,OU=our,DC=our,DC=domain,DC=com' bindpw: password username_attribute: sn name_attribute: displayName ----------------------------------------------------------------------- # bookstore.pm: package bookstore; use Dancer2; use Dancer2::Plugin::Auth::Extensible; use Dancer2::Plugin::Auth::Extensible::Provider::LDAP; our $VERSION = '0.1'; get '/' => sub { template 'index' => { 'title' => 'bookstore' }; }; get '/restricted' => require_login sub { return "You are logged in!!"; }; true; ----------------------------------------------------------------------- error message when attempting to login: [bookstore:7168] core @2020-05-04 21:31:56> looking for post /login in /home/camel/perl5/perlbrew/perls/perl-5.30.1/lib/site_perl/5.30.1/Dancer2/Core/App.pm l. 35 [bookstore:7168] core @2020-05-04 21:31:56> Entering hook core.app.before_request in (eval 305) l. 1 [bookstore:7168] core @2020-05-04 21:31:56> Entering hook plugin.auth_extensible.before_authenticate_user in (eval 305) l. 1 [bookstore:7168] debug @2020-05-04 21:31:56> Attempting to authenticate testuser against realm config1 in /home/camel/perl5/perlbrew/perls/perl-5.30.1/lib/site_perl/5.30.1/Dancer2/Core/Route.pm l. 164 [bookstore:7168] debug @2020-05-04 21:31:57> Binding to LDAP with credentials in /home/camel/perl5/perlbrew/perls/perl-5.30.1/lib/site_perl/5.30.1/Dancer2/Plugin/Auth/Extensible/Provider/LDAP.pm l. 230 [bookstore:7168] error @2020-05-04 21:31:57> config1 provider threw error: LDAP search error: 000004DC: LdapErr: DSID-0C0906DC, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v1db0 at /home/camel/perl5/perlbrew/perls/perl-5.30.1/lib/site_perl/5.30.1/Dancer2/Plugin/Auth/Extensible.pm line 473. in /home/camel/perl5/perlbrew/perls/perl-5.30.1/lib/site_perl/5.30.1/Dancer2/Core/Route.pm l. 164 [bookstore:7168] core @2020-05-04 21:31:57> Entering hook plugin.auth_extensible.after_authenticate_user in (eval 305) l. 1 [bookstore:7168] core @2020-05-04 21:31:57> looking for get /login in /home/camel/perl5/perlbrew/perls/perl-5.30.1/lib/site_perl/5.30.1/Dancer2/Core/App.pm l. 35 [bookstore:7168] core @2020-05-04 21:31:57> Entering hook core.app.before_request in (eval 305) l. 1 [bookstore:7168] debug @2020-05-04 21:31:57> app has no login template defined in /home/camel/perl5/perlbrew/perls/perl-5.30.1/lib/site_perl/5.30.1/Dancer2/Plugin/Auth/Extensible.pm l. 285 [bookstore:7168] core @2020-05-04 21:31:57> Entering hook core.app.after_request in (eval 305) l. 1 127.0.0.1 - - [04/May/2020:21:31:57 -0400] "POST /login?return_url=%2Frestricted HTTP/1.1" 200 1191 "http://localhost:5000/login?return_url=%2Frestricted" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0" 127.0.0.1 - - [04/May/2020:21:31:57 -0400] "GET /css/style.css HTTP/1.1" 304 0 "http://localhost:5000/login?return_url=%2Frestricted" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0" 127.0.0.1 - - [04/May/2020:21:31:57 -0400] "GET /images/perldancer-bg.jpg HTTP/1.1" 304 0 "http://localhost:5000/css/style.css" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0"