• Resolved Barry Sampson

    (@barrysampson)


    Hi,

    Thanks for a great plugin. I’ve been able to successfully set this up – all bar one thing.

    In the Filter field if I enter:

    (&(mail=%s)(objectclass=inetOrgPerson))

    I can log in with my email address.

    If I enter:

    (&(uid=%s)(objectclass=inetOrgPerson))

    I can log in with my username.

    However, if I enter:

    (&(objectclass=inetOrgPerson)(|(mail=%s)(uid=%s)))

    I can’t log in with my email or username.

    In my php error log all I see is:

    No bind successfull. Exception thrown in line 68

    Any help would be much appreciated.

    Barry

Viewing 4 replies - 1 through 4 (of 4 total)
  • I’m not expert at all on this but AFAIK the “|” character is the or, so shouldn’t the last section of your filter be:

    (mail=%s)|(uid=%s)

    As I said – no expert though – I could be wrong ??

    • This reply was modified 7 years, 3 months ago by Steve Cliff.
    Plugin Author heiglandreas

    (@heiglandreas)

    Sorry for not replying earlier. I seem to have missed the notification email for this!

    I’m pretty sure that you need to set up the filter like this:

    (&(objectclass=inetOrgPerson)(|(mail=%1$s)(uid=%1$s))) to work. The username that is given on login is passed to an sprintf within PHP. and when you have %s in there twice the sprintf expects 2 parameters to be given. But there is only one.

    And @stevecliff: That notation is a speciality within LDAP-Filters (that makes absolute sense for others as well). It first gives the way the following items shall be connected and then you can give as many items as you want…

    Thanks for the info regards the LDAP filters ?? And apologies to barry for the duff info!

    Thread Starter Barry Sampson

    (@barrysampson)

    Thank you both.

    In the end it became unnecesary to use both parameters as it was decided to hide usernames from users – so we only needed to validate against email addresses.

    Barry

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘OR parameter in Filter’ is closed to new replies.