Hello,<br><br>We have a LDAP database with many users information and this is the one we use to implement most of our services; on the contrary we have SER working with a SQL data base. Our intention was to make also the authentication against LDAP. After some research, we&#39;ve seen there&#39;s no specific module for SER to work with LDAP and we have considered some alternatives among them there was the <a href="http://www.ethworld.ethz.ch/technologies/sipeth/ser_modules/ldap">&quot;module&quot; from ETH world</a>. However, we didn&#39;t manage to make it work (if it&#39;s an advisable choice we&#39;d appreciate some clues). <br>
<br>So, we decided to make the authentication through the RADIUS server. Nevertheless, we are having some problems with the way data is sent. <br><br>When doing the user authentication there&#39;s no problem as it is sent in plain text and we modified to do it against the email attribute as it&#39;s this what we want. It makes it perfectly. But it turns out that when we try to make the password authentication, as the data sent from SER comes in a hash (user:realm:password) as long as we know, we don&#39;t really know how to make it compare with the password field in LDAP (under MD5 algorithm as well).<br>
<br>When we make a test over Radius by sending plain text it works perfectly so it shouldn&#39;t be a problem by searching the attributes over LDAP.<br><br>We have tried to follow instructions to set the digest section properly but there&#39;s something we definitely miss. <br>
<br>Attached there&#39;s a log from the radius when trying to log with SER and the Register section from SER. <br clear="all"><br>log:<br>03<br>    User-Name = &quot;<a href="mailto:my.user@i2cat.net">my.user@i2cat.net</a>&quot;<br>
    Digest-Attributes = 0x0a0b7061626c6f2e726f73<br>    Digest-Attributes = 0x010b69326361742e6e6574<br>    Digest-Attributes = 0x022a34626466643065343837303734363630626261366134363437663730313034343639663532306532<br>    Digest-Attributes = 0x040f7369703a69326361742e6e6574<br>
    Digest-Attributes = 0x030a5245474953544552<br>    Digest-Response = &quot;6c95bcba1fca30e976fa9295025b1bf4&quot;<br>    Service-Type = Sip-Session<br>    Sip-Uri-User = &quot;my.user&quot;<br>    NAS-Port = 5060<br>    NAS-IP-Address = 127.0.0.1<br>
+- entering group authorize<br>++[preprocess] returns ok<br>++[chap] returns noop<br>++[mschap] returns noop<br>rlm_digest: Adding Auth-Type = DIGEST<br>++[digest] returns ok<br>    rlm_realm: Looking up realm &quot;<a href="http://i2cat.net">i2cat.net</a>&quot; for User-Name = &quot;<a href="mailto:my.user@i2cat.net">my.user@i2cat.net</a>&quot;<br>
    rlm_realm: No such realm &quot;<a href="http://i2cat.net">i2cat.net</a>&quot;<br>++[suffix] returns noop<br>  rlm_eap: No EAP-Message, not doing EAP<br>++[eap] returns noop<br>++[unix] returns notfound<br>++[files] returns noop<br>
rlm_ldap: - authorize<br>rlm_ldap: performing user authorization for <a href="mailto:my.user@i2cat.net">my.user@i2cat.net</a><br>WARNING: Deprecated conditional expansion &quot;:-&quot;.  See &quot;man unlang&quot; for details<br>
    expand: (mail=%{Stripped-User-Name:-%{User-Name}}) -&gt; (mail=<a href="mailto:my.user@i2cat.net">my.user@i2cat.net</a>)<br>    expand: ou=activat,ou=personal,dc=i2cat,dc=net -&gt; ou=activat,ou=personal,dc=i2cat,dc=net<br>
rlm_ldap: ldap_get_conn: Checking Id: 0<br>rlm_ldap: ldap_get_conn: Got Id: 0<br>rlm_ldap: attempting LDAP reconnection<br>rlm_ldap: (re)connect to <a href="http://ldap.i2cat.net:389">ldap.i2cat.net:389</a>, authentication 0<br>
rlm_ldap: bind as cn=anonim,dc=i2cat,dc=net/i2mngr to <a href="http://ldap.i2cat.net:389">ldap.i2cat.net:389</a><br>rlm_ldap: waiting for bind result ...<br>rlm_ldap: Bind was successful<br>rlm_ldap: performing search in ou=activat,ou=personal,dc=i2cat,dc=net, with filter (mail=<a href="mailto:pablo.ros@i2cat.net">pablo.ros@i2cat.net</a>)<br>
rlm_ldap: No default NMAS login sequence<br>rlm_ldap: looking for check items in directory...<br>rlm_ldap: LDAP attribute userPassword as RADIUS attribute Digest-HA1 == &quot;{md5}nCK4tZ5NNP48oT0wlXX+Jw==&quot;<br>rlm_ldap: looking for reply items in directory...<br>
WARNING: No &quot;known good&quot; password was found in LDAP.  Are you sure that the user is configured correctly?<br>rlm_ldap: user <a href="mailto:pablo.ros@i2cat.net">pablo.ros@i2cat.net</a> authorized to use remote access<br>
rlm_ldap: ldap_release_conn: Release Id: 0<br>++[ldap] returns ok<br>++[expiration] returns noop<br>++[logintime] returns noop<br>rlm_pap: WARNING! No &quot;known good&quot; password found for the user.  Authentication may fail because of this.<br>
++[pap] returns noop<br>  rad_check_password:  Found Auth-Type DIGEST<br>auth: type &quot;digest&quot;<br>+- entering group authenticate<br>rlm_digest: Digest-HA1 has invalid length, authentication failed.<br>++[digest] returns invalid<br>
auth: Failed to validate the user.<br>Login incorrect: [<a href="http://my.user@i2cat.net/">my.user@i2cat.net/</a>&lt;via Auth-Type = DIGEST&gt;] (from client localhost port 5060)<br>  Found Post-Auth-Type Reject<br>+- entering group REJECT<br>
    expand: %{User-Name} -&gt; <a href="mailto:my.user@i2cat.net">my.user@i2cat.net</a><br> attr_filter: Matched entry DEFAULT at line 11<br>++[attr_filter.access_reject] returns updated<br>Delaying reject of request 0 for 1 seconds<br>
<br><br>SER register -&gt; User Authentication part<br><br>#------------------------------------------------------------------------<br>        # Comprovacio de credencials per als usuaris.<br>        #------------------------------------------------------------------------<br>
        if (!is_user_in(&quot;From&quot;, &quot;noauth&quot;))<br>        {<br>                xlog(&quot;L_NOTICE&quot;, &quot;SER-INFO: challenging user...\n&quot;);<br>                # IMPORTANTE: radius_www_authorize solo toma un parámetro!<br>
                if(!radius_www_authorize(&quot;&quot;))<br>                {<br>                        # L&#39;usuari NO esta registrat correctament o les<br>                        # credencials no son valides!<br><br>                        www_challenge(&quot;<a href="http://i2cat.net">i2cat.net</a>&quot;,&quot;0&quot;);<br>
                        xlog(&quot;L_ALERT&quot;,&quot;SER-ALERT r[4]-Bad Auth from &lt;%fu&gt;:(%is) [403 Forbiden]\n&quot;);<br>                        sl_send_reply(&quot;403&quot;, &quot;Forbiden!, Bad Credentials&quot;);<br>
                        break; #tallem la comunicacio<br>                };<br>                #--------------------------------------------------------------------<br>                # check_to<br>                #--------------------------------------------------------------------<br>
                if(!check_to())<br>                {<br>                        xlog(&quot;L_ALERT&quot;,&quot;SER-ALERT: check_to(): REG Spoofed attempt &lt;%fu&gt;:(%is)\n&quot;);<br>                        sl_send_reply(&quot;403&quot;, &quot;Use To=id la proxima vegada :@&quot;);<br>
                        consume_credentials(); # fem que caduqui la sessio<br>                        break;<br>                };<br>        }<br><br>-- <br>Pablo Ros<br>