<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hi <br>
    <br>
    and after you client receives the 401, does it generate a new
    request with the credentials ?<br>
    <br>
    Regards,<br>
    Bogdan<br>
    <br>
    <br>
    On 03/29/2012 02:08 PM, azza miled wrote:
    <blockquote
cite="mid:CAGQdkzRGYhcUDWtoansSLMJ1dW2xv8rZRW=MvJJV2EBGcO46Ug@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi!
        <div>When I try to authenticate my users, I get this error
          message:Registration error: 401-Unauthorized.</div>
        <div>in my opensips.cfg&nbsp;</div>
        <div>
          <div>loadmodule "db_mysql.so"</div>
          <div>loadmodule "auth.so"</div>
          <div>loadmodule "auth_db.so"</div>
          <div>modparam("usrloc", "db_mode", 2)</div>
          <div>modparam("usrloc", "db_url",</div>
          <div>&nbsp;"mysql://opensips:opensipsrw@localhost/opensips")</div>
          <div>modparam("auth_db", "calculate_ha1", yes)</div>
          <div>modparam("auth_db", "password_column", "password")</div>
          <div>modparam("auth_db", "db_url",</div>
          <div>&nbsp;"mysql://opensips:opensipsrw@localhost/opensips")</div>
          <div>modparam("auth_db", "load_credentials", "")</div>
          <div>if (!(method=="REGISTER") &amp;&amp; from_uri==myself)
            /*no multidomain version*/</div>
          <div>{</div>
          <div>&nbsp;if (!proxy_authorize("", "subscriber")) {</div>
          <div>&nbsp;proxy_challenge("", "0");</div>
          <div>&nbsp;exit;</div>
          <div>&nbsp;}</div>
          <div>&nbsp;if (!db_check_from()) {</div>
          <div>&nbsp;sl_send_reply("403","Forbidden auth ID");</div>
          <div>exit;</div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div>}</div>
          <div><br>
          </div>
          <div>consume_credentials();</div>
          <div><br>
          </div>
          <div>}</div>
          <div><br>
          </div>
          <div>if (!www_authorize("", "subscriber"))</div>
          <div>{</div>
          <div>www_challenge("", "0");</div>
          <div>exit;</div>
          <div>}</div>
          <div><br>
          </div>
          <div>if (!db_check_to())</div>
          <div>{</div>
          <div>&nbsp;sl_send_reply("403","Forbidden auth ID");</div>
          <div>exit;</div>
          <div>}</div>
          <div><br>
          </div>
        </div>
        <div>I user opensipsctl add 1000 1000 to add user.</div>
        <div>What is strange, is that opensipsctl ping can ping any
          name, even users not added</div>
        <div>an any one help, please :)</div>
      </div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
  </body>
</html>