Code: |
if (! radius_www_authorize("uu.net")) { www_challenge("uu.net", "0"); return; } |
Code: |
route[AUTH] { #!ifdef WITH_AUTH # Primeramente comprobamos si pertenece a nuestro dominio; si no ya no hace falta comprobar credenciales. if (uri==myself) { if (is_method("REGISTER")) { xlog("L_NOTICE","KAM-INFO: r[AUTH] - REGISTER - User info: ($fu):($si)>\n"); if (!radius_www_authorize("i2cat.net")){ route(RADIUS); #www_challenge("i2cat.net","0"); exit; } } if ($au!=$tU) { sl_send_reply("403","Forbidden auth ID"); exit; } } else { #!ifdef WITH_IPAUTH if(allow_source_address()) { # source IP allowed return; } #!endif # authenticate if from local subscriber if (from_uri==myself) { if (!proxy_authorize("$fd", "subscriber")) { proxy_challenge("$fd", "0"); exit; } if (is_method("PUBLISH")) { if ($au!=$tU) { sl_send_reply("403","Forbidden auth ID"); exit; } } else { if ($au!=$fU) { sl_send_reply("403","Forbidden auth ID"); exit; } } consume_credentials(); # caller authenticated } else { # caller is not local subscriber, then check if it calls # a local destination, otherwise deny, not an open relay here if (!uri==myself) { sl_send_reply("403","Not relaying"); exit; } } } #!endif return; } |
Code: |
route[RADIUS] { sl_send_reply("100", "Trying"); append_to_reply("Expires: 600\r\n"); append_to_reply("Min-Expires: 240\r\n"); xlog("L_NOTICE","KAM-INFO: RADIUS AUTHENTICATION - AUTHORIZING USER $fU - <$fu>:<$si>\n"); xlog("L_NOTICE","KAM-INFO: CHALLENGING. - RETCODE-> $rc \n"); www_challenge("i2cat.net", "0"); switch($rc){ case -5: xlog("L_INFO", "-> 500: internal server error"); sl_send_reply("500", "Internal Server Error"); case -4: xlog("L_INFO", "-> 404: credentials not found"); sl_send_reply("404", "Credentials Not Found"); case -3: xlog("L_INFO", "-> 400: bad request - stale nonce"); sl_send_reply("400", "Bad Request"); case -2: xlog("L_INFO", "-> 401: invalid password"); sl_send_reply("401", "Invalid Password"); case -1: xlog("L_INFO", "-> 401: invalid user"); sl_send_reply("401", "Invalid User"); default: xlog("L_INFO", "-> 401: unauthorized"); sl_send_reply("401", "Unauthorized"); } } |
Code: |
4(31099) DEBUG: auth [api.c:95]: auth: digest-algo: MD5 parsed value: 1 4(31099) DEBUG: auth_radius [sterman.c:271]: radius_authorize_sterman(): Success 4(31099) WARNING: auth_radius [authorize.c:89]: RADIUS server did not send SER-UID attribute in digest authentication reply 4(31099) DEBUG: auth [challenge.c:102]: build_challenge_hf: realm='i2cat.net' 4(31099) DEBUG: auth [challenge.c:113]: build_challenge_hf: qop='auth' 4(31099) DEBUG: auth [challenge.c:236]: auth: 'WWW-Authenticate: Digest realm="i2cat.net", nonce="TWZJLk1mSAKFVzL0b+dVPzkuyyAnZHQs", qop="auth" |