|
1 LCR module authentication extention (contribution) |
|
2 |
|
3 Rationale |
|
4 |
|
5 An orthoganal approach to abstract authentication logic out of the |
|
6 routing script improves administration by keeping unnecessarily hard |
|
7 coded authentication credentials out of the routing script. |
|
8 |
|
9 Usage |
|
10 |
|
11 The new lcr module parameters which achieve this are 'auth_realm_avp', |
|
12 'auth_username_avp', and 'auth_password_avp'. To specify where the lcr |
|
13 module should write these values set the parameters like so: |
|
14 |
|
15 modparam("lcr", "auth_realm_avp", "$avp(s:arealm)") |
|
16 modparam("lcr", "auth_username_avp", "$avp(s:auser)") |
|
17 modparam("lcr", "auth_password_avp", "$avp(s:apass)") |
|
18 |
|
19 Typically these parameters are used in conjunction with the uac modules |
|
20 uac_auth() function, which uses similar variables which are specified in |
|
21 a similar manner. In fact, the parameters of both lcr and uac modules |
|
22 can be specified at the same time like so: |
|
23 |
|
24 modparam("uac|lcr", "auth_realm_avp", "$avp(s:arealm)") |
|
25 modparam("uac|lcr", "auth_username_avp", "$avp(s:auser)") |
|
26 modparam("uac|lcr", "auth_password_avp", "$avp(s:apass)") |
|
27 |
|
28 In addition to the existing column module parameters, specify the name |
|
29 of each of the new gw table columns like so: |
|
30 |
|
31 modparam("lcr", "user_column", "user") |
|
32 modparam("lcr", "realm_column", "realm") |
|
33 modparam("lcr", "passwd_column", "passwd") |
|
34 |
|
35 At this point the new functionality of the lcr module is ready to be |
|
36 used. Enter values into the gw table with its new columns and call the |
|
37 standard lcr module functions load_gws() and next_gw(). |
|
38 |
|
39 Result |
|
40 |
|
41 After calling load_gws() and next_gw(), inspect the variables associated |
|
42 with the user, realm, and password columns (see the modparam entries) to |
|
43 find that the lcr module can now hand off authentication credentials to |
|
44 other modules with ease. |
|
45 |
|
46 Location |
|
47 |
|
48 http://scm.europalab.com/contrib/opensips/ |
|
49 http://scm.europalab.com/contrib/file/tip/opensips/ |
|
50 http://scm.europalab.com/contrib/file/tip/opensips/lcr-auth.txt |
|
51 http://scm.europalab.com/contrib/file/tip/opensips/lcr-auth.diff |
|
52 |
|
53 Instructions |
|
54 |
|
55 To integrate this contributed logic into the source code tree of |
|
56 a OpenSIPS distribution, download the unified diff and use the |
|
57 patch(1) command: |
|
58 |
|
59 $ cd /tmp && mkdir lcr-patch && cd lcr-patch |
|
60 $ wget http://scm.europalab.com/contrib/raw-file/tip/opensips/lcr-auth.diff |
|
61 $ tar zxf /tmp/opensips-<version>-tls.tar.gz |
|
62 $ cd opensips-<version>-tls |
|
63 $ patch -p0 <../lcr-auth.diff |
|
64 |
|
65 Disclaimer |
|
66 |
|
67 This software contribution is based on source code from OpenSIPS SVN |
|
68 revision 6590. The author makes no guarantees as to this contribution. |
|
69 A user who downloads and executes it does so at his own risk. |
|
70 |
|
71 Michael Schloh von Bennewitz |
|
72 http://michael.schloh.com/ |
|
73 Wednsday, 10. February 2010 |