diff -r c5c55937e44c -r 733187d496d0 opensips/lcr-auth.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/opensips/lcr-auth.txt Wed Feb 10 21:21:24 2010 +0100 @@ -0,0 +1,73 @@ +LCR module authentication extention (contribution) + +Rationale + +An orthoganal approach to abstract authentication logic out of the +routing script improves administration by keeping unnecessarily hard +coded authentication credentials out of the routing script. + +Usage + +The new lcr module parameters which achieve this are 'auth_realm_avp', +'auth_username_avp', and 'auth_password_avp'. To specify where the lcr +module should write these values set the parameters like so: + + modparam("lcr", "auth_realm_avp", "$avp(s:arealm)") + modparam("lcr", "auth_username_avp", "$avp(s:auser)") + modparam("lcr", "auth_password_avp", "$avp(s:apass)") + +Typically these parameters are used in conjunction with the uac modules +uac_auth() function, which uses similar variables which are specified in +a similar manner. In fact, the parameters of both lcr and uac modules +can be specified at the same time like so: + + modparam("uac|lcr", "auth_realm_avp", "$avp(s:arealm)") + modparam("uac|lcr", "auth_username_avp", "$avp(s:auser)") + modparam("uac|lcr", "auth_password_avp", "$avp(s:apass)") + +In addition to the existing column module parameters, specify the name +of each of the new gw table columns like so: + + modparam("lcr", "user_column", "user") + modparam("lcr", "realm_column", "realm") + modparam("lcr", "passwd_column", "passwd") + +At this point the new functionality of the lcr module is ready to be +used. Enter values into the gw table with its new columns and call the +standard lcr module functions load_gws() and next_gw(). + +Result + +After calling load_gws() and next_gw(), inspect the variables associated +with the user, realm, and password columns (see the modparam entries) to +find that the lcr module can now hand off authentication credentials to +other modules with ease. + +Location + +http://scm.europalab.com/contrib/opensips/ +http://scm.europalab.com/contrib/file/tip/opensips/ +http://scm.europalab.com/contrib/file/tip/opensips/lcr-auth.txt +http://scm.europalab.com/contrib/file/tip/opensips/lcr-auth.diff + +Instructions + +To integrate this contributed logic into the source code tree of +a OpenSIPS distribution, download the unified diff and use the +patch(1) command: + + $ cd /tmp && mkdir lcr-patch && cd lcr-patch + $ wget http://scm.europalab.com/contrib/raw-file/tip/opensips/lcr-auth.diff + $ tar zxf /tmp/opensips--tls.tar.gz + $ cd opensips--tls + $ patch -p0 <../lcr-auth.diff + +Disclaimer + +This software contribution is based on source code from OpenSIPS SVN +revision 6590. The author makes no guarantees as to this contribution. +A user who downloads and executes it does so at his own risk. + +Michael Schloh von Bennewitz +http://michael.schloh.com/ +Wednsday, 10. February 2010