[OpenSIPS-Users] Fw: Proxy authorization using MongoDB in Opensips

Harsh Patel harsh.patel at inextrix.com
Wed Nov 1 07:07:11 UTC 2023


 I am currently using MySQL to proxy authorization using the auth_db module. I am utilizing the proxy_authorize function to authorize users in a MySQL table, and it is working perfectly.

However, I need to switch to MongoDB as my database instead of MySQL. The issue is that it appears auth_db only supports MySQL and PostgreSQL databases. My concern is that I must use MongoDB as the database for authorization in OpenSIPS. Is it possible to authorize users in OpenSIPS using MongoDB with the auth_db module, or should I consider an alternative module or approach?

Load auth_db module

loadmodule "auth_db.so"
modparam("auth_db", "db_url", "mysql://DB_USER:DB_PASSWORD@DB_HOST/DB_NAME")
modparam("auth_db", "load_credentials", "$avp(tmp_id)=id")
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")

check condition in routes.

if (!proxy_authorize("", "TABLE)_NAME")) {
      proxy_challenge("", "0");
      exit;
}

Best Regards,
----
Harsh Patel
Team Lead.
Inextrix Technologies Pvt Ltd (www.inextrix.com)
Mo: +1 315 898 1049
https://www.inextrix.com/

Disclaimer:
The information contained in this communication is confidential and may be legally privileged. It is intended solely for the use of the individual or entity to whom it is addressed and others authorized to receive it. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution or taking action in reliance on the contents of this information is strictly prohibited and may be unlawful. Please notify the sender immediately and destroy all copies of this message and any attachments contained in it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20231101/9028cfb0/attachment.html>


More information about the Users mailing list