[OpenSIPS-Users] OpenSIPS and REDIS
Bogdan-Andrei Iancu
bogdan at opensips.org
Thu Jun 29 06:51:06 EDT 2017
Hi Michele,
What you fetch from REDIS is the plain-text password, right ? Have you
checked if the loaded pwd is correct ?
Best regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
OpenSIPS Bootcamp 2017, Houston, US
http://opensips.org/training/OpenSIPS_Bootcamp_2017.html
On 06/14/2017 10:45 AM, Michele Pinassi wrote:
> Hi all,
>
> i'm trying to setup a REDIS cache to share register data with my two
> OpenSIPS server, to have some redundancy.
>
> On opensips.cfg:
>
> #### AUTHentication modules
> loadmodule "auth.so"
> modparam("auth", "username_spec", "$var(username)")
> modparam("auth", "password_spec", "$avp(password)")
> modparam("auth", "disable_nonce_check", 1)
>
> loadmodule "auth_db.so"
> modparam("auth_db", "calculate_ha1", 1)
> modparam("auth_db", "password_column", "password")
> modparam("auth_db", "load_credentials", "$avp(password)=password")
>
> [...]
>
> #### Redis module
> loadmodule "cachedb_redis.so"
> modparam("cachedb_redis", "cachedb_url", "redis:voip://192.168.1.1:6379/")
>
> [...]
>
> ### REGISTER
> if (is_method("REGISTER")) {
> # Check for cache...
> if(cache_fetch("redis:voip","passwd_$tU",$avp(password))) {
> $var(username) = $tU;
> $var(rc) = pv_www_authorize("");
> } else {
> # or authenticate the REGISTER requests...
> $var(rc) = www_authorize("","subscriber");
> }
>
> switch($var(rc)) {
> case 1 :
> xlog("L_INFO", "Registration SUCCESS $fu\n");
> # Save credentials to REDIS cache
>
> cache_store("redis:voip","passwd_$tU","$avp(password)",128000);
> break;
> case -1:
> xlog("L_ERR","Auth error for $fU@$fd from $si:
> INVALID USER");
> break;
> case -2:
> xlog("L_ERR","Auth error for $fU@$fd from $si:
> INVALID PASSWORD");
> break;
> case -3: # Stale nonce - This is not an error, so don't
> print anything
> break;
> case -4:
> www_challenge("", "0");
> break;
> default:
> xlog("L_ERR","Auth error for $fU@$fd from $si cause
> $var(rc)");
> }
>
> but i got an INVALID PASSWORD for all account stored in REDIS cache.
> What's wrong ?
>
> Thanks, Michele
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20170629/c9e950b4/attachment.html>
More information about the Users
mailing list