Jasig/cas — pull request #655 by skibaa (2014-08-11 16:50:28+00:00)
Title: Allow to customize search filter for LDAP. Fixes #CAS-1482

[ copied from https://issues.jasig.org/browse/CAS-1482 ]
Our corporate Active Directory has users migrated to another domain. As a result, it is necessary to bind to LDAP with DN including domain name (like `user@COMPANY`), but to perform the search with user name only. I created a patch, which adds property `searchUserOnly` which defaults to false to keep the current behavior. Also, I created a property `searchFilter` to override the current string:

userPrincipalName={0}

with search filter I had to use for our Active Directory:

(&(objectClass=user)(sAMAccountName={0}))

So I can define bean like:

in a property file I have ldap.searchFilter specified as:

ldap.searchFilter=(&(objectClass=user)(sAMAccountName={0}))