Project

General

Profile

Passing Login-Variable to a LDAP-Filter-String for some group filter

Added by Sebastian mf almost 12 years ago

Hallo,

I've setup a LDAP-Authentication against a Samba 4 PDC.
Users can be validated against an organisational unit OU in the domain.

Now I want to check if they are member of a specific group.
So I setup a filter:

&(objectClass=user)(sAMAccountName=redmine_001)(memberof=CN=Redmine,OU=mfitc,DC=fritz,DC=box))

This works for the hardcoded user redmine_001

Now I want to replace redmine_001 with a variable substituted with the login name.
So I've tryed several modifications replacing redmine_001 with

$login, %login, $Login
%username, %username%, $username
%{login}

But nothing works for me.
I've just done a tcpdump on the connection to the Samba4 PDC and I see that the variable is not substituted. It's just provided as is. Naturally this doesn't work.

Any help would be appreciated.

Regards

Sebastian