Freeradius Filter ID

家住魔仙堡 提交于 2019-12-12 06:44:35

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!