问题
Would really appreciate some help or some hints for a Freeradius config to return the Filter ID value based on DN.
I have two types of DN:
DN: cn=UserA,ou=Value1,ou=People,dc=example,dc=com and
DN: cn=UserB,ou=Value2,ou=People,dc=example,dc=com
My aim is to have the Filter ID value to be Value1 or Value2 from the above examples
Thank you
回答1:
ldap
if (&LDAP-UserDN =~ /^.*ou=([^=,]+),ou=People,dc=example,dc=com$/) {
update reply {
Filter-ID := "%{1}"
}
}
You can use regex sub-capture groups to do what you want.
来源:https://stackoverflow.com/questions/43913834/freeradius-filter-id