Forum Discussion

ak2766's avatar
ak2766
Icon for Nimbostratus rankNimbostratus
Mar 29, 2022

Complex AD Query

I've seen THIS THREAD and although helpful in understanding the syntax, it did not help for my specific situation,

We have an IdP that authenticates users via their uid.  As such, I've configured the searchFilter as uid=%{session.logon.last.username} and this is currently working well.  However, I'm trying give the end user the flexibility of entering either sAMAccountName || email || uid.  I'm looking for something similar to this logic:

get details of user where %{session.logon.last.username} matches sAMAcccountName || email || uid
send uid of matched user to RADIUS

 If this is doable, how?

  • Hello ak2766.

    Have you tested with this sentence in your searchFilter field?

     

    (|(uid=%{session.logon.last.username})(email=%{session.logon.last.username})(sAMAccountName=%{session.logon.last.username}))

     

    Also, my recommendation is to use ldapsearch command to check if the query is getting all that you need and after that, translate it to the LDAP/AD query.