|
@@ -422,17 +422,17 @@ if (!www_authorize("kamailio.org", "subscriber")) {
|
|
|
</section>
|
|
|
|
|
|
<section>
|
|
|
- <title><function moreinfo="none">ims_www_authenticate(realm,
|
|
|
- table)</function></title>
|
|
|
+ <title><function
|
|
|
+ moreinfo="none">ims_www_authenticate(realm)</function></title>
|
|
|
|
|
|
- <para>It is same function as www_authenticate(realm, table). This name
|
|
|
- is kept for backward compatibility, since it was named this way first
|
|
|
- time by it actually does user authentication.</para>
|
|
|
+ <para>It is the same function as www_authenticate(realm, table). This
|
|
|
+ name is kept for backward compatibility, since it was named this way
|
|
|
+ first time by it actually does user authentication.</para>
|
|
|
</section>
|
|
|
|
|
|
<section>
|
|
|
- <title><function moreinfo="none">ims_www_challenge(route_block, realm,
|
|
|
- table)</function></title>
|
|
|
+ <title><function moreinfo="none">ims_www_challenge(route_block,
|
|
|
+ realm)</function></title>
|
|
|
|
|
|
<para>Name alias: proxy_authorize(realm, table)</para>
|
|
|
|
|
@@ -471,17 +471,12 @@ if (!www_authorize("kamailio.org", "subscriber")) {
|
|
|
|
|
|
<para>The string may contain pseudo variables.</para>
|
|
|
</listitem>
|
|
|
-
|
|
|
- <listitem>
|
|
|
- <para><emphasis>table</emphasis> - Table to be used to lookup
|
|
|
- usernames and passwords (usually subscribers table).</para>
|
|
|
- </listitem>
|
|
|
</itemizedlist>
|
|
|
|
|
|
<para>This function can be used from REQUEST_ROUTE.</para>
|
|
|
|
|
|
<example>
|
|
|
- <title>proxy_authorize usage</title>
|
|
|
+ <title>ims_www_challenge usage</title>
|
|
|
|
|
|
<programlisting format="linespecific">
|
|
|
...
|
|
@@ -513,6 +508,53 @@ route[REG_MAR_REPLY]
|
|
|
}
|
|
|
exit;
|
|
|
}
|
|
|
+</programlisting>
|
|
|
+ </example>
|
|
|
+ </section>
|
|
|
+
|
|
|
+ <section>
|
|
|
+ <title><function moreinfo="none">ims_www_challenge(route_block, realm,
|
|
|
+ algorithm)</function></title>
|
|
|
+
|
|
|
+ <para>Same as 4.3 except here there is the addiional option to specify
|
|
|
+ the authorisation algorithm</para>
|
|
|
+
|
|
|
+ <itemizedlist>
|
|
|
+ <listitem>
|
|
|
+ <para><emphasis>algorithm</emphasis> - The algorithm to be used when
|
|
|
+ challenging the client. Can be AKAv1-MD5, AKAv2-MD5, MD5, or
|
|
|
+ HSS-Selected. If left as an empty string, the default algorithm will
|
|
|
+ be chosen according to the parameter registration_default_algorithm
|
|
|
+ (see section 3.7)</para>
|
|
|
+ </listitem>
|
|
|
+ </itemizedlist>
|
|
|
+
|
|
|
+ <para>This function can be used from REQUEST_ROUTE.</para>
|
|
|
+
|
|
|
+ <example>
|
|
|
+ <title>ims_www_challenge usage</title>
|
|
|
+
|
|
|
+ <programlisting format="linespecific">
|
|
|
+...
|
|
|
+ if (!ims_www_authenticate(NETWORKNAME)) {
|
|
|
+ #user has not been authenticated. Lets send a challenge via 401 Unauthorized
|
|
|
+ if ($? == -2) {
|
|
|
+ t_reply("403", "Authentication Failed");
|
|
|
+ exit;
|
|
|
+ } else if ($? == -3) {
|
|
|
+ t_reply("400", "Bad Request");
|
|
|
+ exit;
|
|
|
+ } else if ($? == -9) {
|
|
|
+ xlog("L_DBG", "Authentication re-sync requested\n");
|
|
|
+ ims_www_resync_auth("REG_RESYNC_REPLY", "$td");
|
|
|
+ exit;
|
|
|
+ } else {
|
|
|
+ xlog("L_DBG","About to challenge! auth_ims\n");
|
|
|
+ ims_www_challenge("REG_MAR_REPLY", "$td", "MD5");
|
|
|
+ exit;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
</programlisting>
|
|
|
</example>
|
|
|
</section>
|