PerlDancer / Dancer2-Plugin-Auth-Extensible-Provider-LDAP

LDAP provider for Dancer2::Plugin::Auth::Extensible
1 stars 4 forks source link

Roles search #4

Closed actarusvb closed 4 years ago

actarusvb commented 7 years ago

Hi,

sorry for my mistakes, but i had hardly work around this module and by the end i see we got a problem in searching user roles because we use uid to identify user into groups looking for memberUid multivalue. So i had arrange changing filter from

now get the roles

    $mesg = $ldap->search(
        base   => $self->basedn,
        filter => '(&'
          . $self->role_filter . '('
          . $self->role_member_attribute . '='
         . **$entry->dn** . '))',

to

now get the roles

    $mesg = $ldap->search(
        base   => $self->basedn,
        filter => '(&'
          . $self->role_filter . '('
          . $self->role_member_attribute . '='
      . **$entry->get_value($self->name_attribute)**.'))');

I don't know if i had done a good job but it work for me and may be integrate (in a better manner) ?

ciao

cPanelScott commented 4 years ago

I'm having a similar problem, but I'm not able to use the name_attribute as its value is important in other places. If I can find some time, I'll prepare a PR for this.

I know it's been a while since this Issue was submitted, so I don't know if anyone else would find it valuable. If anyone is interested in this, please "Thumbs Up" this comment so that I can get an idea of how useful it would be.

SysPete commented 4 years ago

@cPanelScott :+1: from me. I don't have a use for it right now, but I have a possible use for it later next year. I'd love to see much more flexibility in this provider, I just don't have an itch to scratch right now.