README 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. The LDAP Authorization plugin allows for StatusNet to handle authorization
  2. through LDAP.
  3. Installation
  4. ============
  5. add "addPlugin('ldapAuthorization',
  6. array('setting'=>'value', 'setting2'=>'value2', ...);"
  7. to the bottom of your config.php
  8. You *cannot* use this plugin without the LDAP Authentication plugin
  9. Settings
  10. ========
  11. provider_name*: This is a identifier designated to the connection.
  12. It's how StatusNet will refer to the authentication source.
  13. For the most part, any name can be used, so long as each authentication
  14. source has a different identifier. In most cases there will be only one
  15. authentication source used.
  16. authoritative (false): should this plugin be authoritative for
  17. authorization?
  18. uniqueMember_attribute ('uniqueMember')*: the attribute of a group
  19. that lists the DNs of its members
  20. roles_to_groups: array that maps StatusNet roles to LDAP groups
  21. some StatusNet roles are: moderator, administrator, sandboxed, silenced
  22. login_group: if this is set to a group DN, only members of that group will be
  23. allowed to login
  24. The below settings must be exact copies of the settings used for the
  25. corresponding LDAP Authentication plugin.
  26. host*: LDAP server name to connect to. You can provide several hosts in an
  27. array in which case the hosts are tried from left to right.
  28. See http://pear.php.net/manual/en/package.networking.net-ldap2.connecting.php
  29. port: Port on the server.
  30. See http://pear.php.net/manual/en/package.networking.net-ldap2.connecting.php
  31. version: LDAP version.
  32. See http://pear.php.net/manual/en/package.networking.net-ldap2.connecting.php
  33. starttls: TLS is started after connecting.
  34. See http://pear.php.net/manual/en/package.networking.net-ldap2.connecting.php
  35. binddn: The distinguished name to bind as (username).
  36. See http://pear.php.net/manual/en/package.networking.net-ldap2.connecting.php
  37. bindpw: Password for the binddn.
  38. See http://pear.php.net/manual/en/package.networking.net-ldap2.connecting.php
  39. basedn*: LDAP base name (root directory).
  40. See http://pear.php.net/manual/en/package.networking.net-ldap2.connecting.php
  41. options: See http://pear.php.net/manual/en/package.networking.net-ldap2.connecting.php
  42. filter: Default search filter.
  43. See http://pear.php.net/manual/en/package.networking.net-ldap2.connecting.php
  44. scope: Default search scope.
  45. See http://pear.php.net/manual/en/package.networking.net-ldap2.connecting.php
  46. attributes: an array that relates StatusNet user attributes to LDAP ones
  47. username*: LDAP attribute value entered when authenticating to StatusNet
  48. * required
  49. default values are in (parenthesis)
  50. Example
  51. =======
  52. Here's an example of an LDAP plugin configuration that connects to
  53. Microsoft Active Directory.
  54. addPlugin('ldapAuthentication', array(
  55. 'provider_name'=>'Example',
  56. 'authoritative'=>true,
  57. 'autoregistration'=>true,
  58. 'binddn'=>'username',
  59. 'bindpw'=>'password',
  60. 'basedn'=>'OU=Users,OU=StatusNet,OU=US,DC=americas,DC=global,DC=loc',
  61. 'host'=>array('server1', 'server2'),
  62. 'password_encoding'=>'ad',
  63. 'attributes'=>array(
  64. 'username'=>'sAMAccountName',
  65. 'nickname'=>'sAMAccountName',
  66. 'email'=>'mail',
  67. 'fullname'=>'displayName',
  68. 'password'=>'unicodePwd')
  69. ));
  70. addPlugin('ldapAuthorization', array(
  71. 'provider_name'=>'Example',
  72. 'authoritative'=>false,
  73. 'uniqueMember_attribute'=>'member',
  74. 'roles_to_groups'=> array(
  75. 'moderator'=>'CN=SN-Moderators,OU=Users,OU=StatusNet,OU=US,DC=americas,DC=global,DC=loc',
  76. 'administrator'=> array('CN=System-Adminstrators,OU=Users,OU=StatusNet,OU=US,DC=americas,DC=global,DC=loc',
  77. 'CN=SN-Administrators,OU=Users,OU=StatusNet,OU=US,DC=americas,DC=global,DC=loc')
  78. ),
  79. 'binddn'=>'username',
  80. 'bindpw'=>'password',
  81. 'basedn'=>'OU=Users,OU=StatusNet,OU=US,DC=americas,DC=global,DC=loc',
  82. 'host'=>array('server1', 'server2'),
  83. 'attributes'=>array(
  84. 'username'=>'sAMAccountName')
  85. ));