Hey,
I used Ldap with Dancer and it works pretty fine. Now I want to develop a new microsite, I thought it would be better with Dancer2(0.206000). But I cannot make the Ldap (0.702) authentication to work.
I turned on the ldap logging. By the log It looks working, because it found the user, but the page says login failed. The second search for the groups has 0 match, the user doesn't member of any group. But I can log in with the user foo, and he is not a member of any group neither. The result is LOGIN FAILED.
In the Dancer2 log says:
Odd number of elements in anonymous hash at /usr/local/share/perl/5.24.1/Dancer2/Plugin/Auth/Extensible/Provider/LDAP.pm line 279.
OpenLdap log:
Oct 10 14:35:13 openldap01 slapd[991]: conn=674413 fd=106 ACCEPT from IP=a.b.c.d:47724 (IP=0.0.0.0:389)Oct 10 14:35:13 openldap01 slapd[991]: conn=674413 op=0 BIND dn="cn=Administrator,dc=gothamcity,dc=example,dc=com" method=128Oct 10 14:35:13 openldap01 slapd[991]: conn=674413 op=0 BIND dn="cn=Administrator,dc=gothamcity,dc=example,dc=com" mech=SIMPLE ssf=0Oct 10 14:35:13 openldap01 slapd[991]: conn=674413 op=0 RESULT tag=97 err=0 text=Oct 10 14:35:13 openldap01 slapd[991]: conn=674413 op=1 SRCH base="dc=example,dc=com" scope=2 deref=2 filter="(&(objectClass=inetOrgPerson)(uid=battila))"Oct 10 14:35:13 openldap01 slapd[991]: conn=674413 op=1 SEARCH RESULT tag=101 err=0 nentries=1 text=Oct 10 14:35:13 openldap01 slapd[991]: conn=674413 op=2 SRCH base="dc=example,dc=com" scope=2 deref=2 filter="(&(objectClass=groupOfNames)(member=uid=battila,ou=people,dc=gothamcity,dc=example,dc=com))"Oct 10 14:35:13 openldap01 slapd[991]: conn=674413 op=2 SEARCH RESULT tag=101 err=0 nentries=0 text=Oct 10 14:35:13 openldap01 slapd[991]: conn=674413 op=3 UNBINDOct 10 14:35:13 openldap01 slapd[991]: conn=674413 fd=106 closedUser entry in the openldap:
dn: uid=battila,ou=people,dc=gothamcity,dc=example,dc=comcn: Attila BardigidNumber: 1901givenName: AttilaloginShell: /bin/bashdescription: exampleobjectClass: topobjectClass: posixAccountobjectClass: shadowAccountobjectClass: inetOrgPersonshadowInactive: -1shadowLastChange: 14284shadowMax: 99999shadowMin: 0shadowWarning: 7sn: Bardiuid: battilauidNumber: 43821homeDirectory: /home/battilamail: battila@example.comstructuralObjectClass: inetOrgPersonentryUUID: d3a89750-5a5e-1038-9b9a-dbf2c7148bb9creatorsName: cn=Administrator,dc=gothamcity,dc=example,dc=comcreateTimestamp: 20181002071629ZuserPassword:: e1e1ee1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1e1eentryCSN: 20181002075005.324787Z#000000#000#000000modifiersName: uid=battila,ou=people,dc=gothamcity,dc=example,dc=commodifyTimestamp: 20181002075005ZDancer2 config.yml
plugins: Auth::Extensible: realms:
config:
provider: Config
users:
- user: 'foo'
pass: 'secret'
users:
provider: LDAP
host: 'openldap01'
binddn: 'cn=Administrator,dc=gothamcity,dc=example,dc=com'
bindpw: 'secret'
basedn: 'dc=example,dc=com'
user_filter: '(objectClass=inetOrgPerson)'
username_attribute: "uid"
I tried disable_roles: 1 after this but the result is still LOGIN FAILED.
I tried to turn on debugging, as I saw the Dancer2::Plugin::Auth::Extensible::Provider::LDAP module has some messages sending with debug, but they haven't been displayed.
log: 'core'
startup_info: 1
show_errors: 1
logger: console