Map LDAP Attribute to RADIUS Attribute

Paul Asadoorian paul at
Wed Jul 19 15:57:00 CEST 2006

Hash: SHA1


I am running FreeRADIUS version 1.1.2 on Debian Linux (Stable x86).   
I am trying to map an LDAP attribute to a RADIUS attribute.  A little  
background, we have a RADIUS client that needs to make decisions  
based on an LDAP attribute (we'll call it User-Category).  Based on  
the value of this attribute the end user will be given rights on the  
network.  So, I setup my ldap.attrmap with *only* the following line:

replyItem       User-Category                   orgPrimaryAffiliation

I setup the following config for rlm_ldap:

server = ""
                 identity = "cn=Radius_admin,ou=Special  
                 password = 12345
                 basedn = "dc=org,dc=com"
                 filter = "(&(objectclass=*) (orgShortid=%{Stripped- 
                 base_filter = "(objectclass=*)"
#               port = 636
                 port = 389

The following debug logs show the successful authentication of the  
user and the mapping of the attributes:

rad_recv: Access-Request packet from host, id=192,  
         User-Name = "mytestuser"
         User-Password = "12345"
         NAS-IP-Address =
         NAS-Port = 1812
   Processing the authorize section of radiusd.conf
modcall: entering group authorize for request 4
   modcall[authorize]: module "preprocess" returns ok for request 4
   modcall[authorize]: module "chap" returns noop for request 4
   modcall[authorize]: module "mschap" returns noop for request 4
     rlm_realm: No '@' in User-Name = "mytestuser", looking up realm  
     rlm_realm: No such realm "NULL"
   modcall[authorize]: module "suffix" returns noop for request 4
rlm_ldap: - authorize
rlm_ldap: performing user authorization for mytestuser
radius_xlat:  '(&(objectclass=*) (orgShortid=mytestuser))'
radius_xlat:  'dc=org,dc=com'
rlm_ldap: ldap_get_conn: Checking Id: 0
rlm_ldap: ldap_get_conn: Got Id: 0
rlm_ldap: performing search in dc=org,dc=com, with filter (& 
(objectclass=*) (orgShortid=mytestuser))
rlm_ldap: looking for check items in directory...
rlm_ldap: looking for reply items in directory...
rlm_ldap: Adding orgPrimaryAffiliation as User-Category, value  
student & op=11
rlm_ldap: Setting Auth-Type = ldap
rlm_ldap: user mytestuser authorized to use remote access
rlm_ldap: ldap_release_conn: Release Id: 0
   modcall[authorize]: module "ldap" returns ok for request 4
modcall: leaving group authorize (returns ok) for request 4
   rad_check_password:  Found Auth-Type ldap
auth: type "LDAP"
   Processing the authenticate section of radiusd.conf
modcall: entering group LDAP for request 4
rlm_ldap: - authenticate
rlm_ldap: login attempt by "mytestuser" with password "12345"
rlm_ldap: user DN: orgUUID=53d66879-e0a0- 
rlm_ldap: (re)connect to, authentication 1
rlm_ldap: bind as orgUUID=53d66879-e0a0- 
da8f-4c49-514b567713ad,ou=People,dc=org,dc=com/12345 to
rlm_ldap: waiting for bind result ...
rlm_ldap: Bind was successful
rlm_ldap: user mytestuser authenticated succesfully
   modcall[authenticate]: module "ldap" returns ok for request 4
modcall: leaving group LDAP (returns ok) for request 4
Sending Access-Accept of id 192 to port 32904
Finished request 4

The problem is that I never see the RADIUS server return the "User- 
Category" attribute back to the RADIUS client.  It seems to only want  
to send the "Access-Accept" or "Access-Reject" message with no User- 
Category value.  I tried including the "User-Category" in the request  
with no luck. I also modified the "attrs" file to include this  

         Service-Type == Framed-User,
         Service-Type == Login-User,
         Login-Service == Telnet,
         Login-Service == Rlogin,
         Login-Service == TCP-Clear,
         Login-TCP-Port <= 65536,
         Framed-IP-Address ==,
         Framed-IP-Netmask ==,
         Framed-Protocol == PPP,
         Framed-Protocol == SLIP,
         Framed-Compression == Van-Jacobson-TCP-IP,
         Framed-MTU >= 576,
         Framed-Filter-ID =* ANY,
         Reply-Message =* ANY,
         User-Category =* ANY,
         Proxy-State =* ANY,
         Session-Timeout <= 28800,
         Idle-Timeout <= 600,
         Port-Limit <= 2

But no luck there either.  Any help is greatly appreciated.

Thank You,


- --
Paul Asadoorian
Email:   paul at
IRC:      #pauldotcom |

Fingerprint: 2693 0204 8497 2E5F 4853  11D5 1153 6151 487F E094

Version: GnuPG v1.4.1 (Darwin)


More information about the Freeradius-Users mailing list