usergroupservices.rst 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. .. _security_rolesystem_usergroupservices:
  2. User/group services
  3. ===================
  4. A **user/group service** provides the following information for users and groups:
  5. * Listing of users
  6. * Listing of groups, including users affiliated with each group
  7. * User passwords
  8. Many authentication providers will make use of a user/group service to perform authentication. In this case, the user/group service would be the database against which users and passwords are authenticated. Depending on how the :ref:`security_auth_chain` is configured, there may be zero, one, or multiple user/group services active at any given time.
  9. A user/group service may be read-only, providing access to user information but not allowing new users and groups to be added or altered. This may occur if a user/group service was configured to delegate to an external service for the users and groups database. An example of this would be an external LDAP server.
  10. By default, GeoServer support three types of user/group services:
  11. * :ref:`XML<security_rolesystem_usergroupxml>`—*(Default)* User/group service persisted as XML
  12. * :ref:`JDBC<security_rolesystem_usergroupjdbc>`—User/group service persisted in database via JDBC
  13. * :ref:`LDAP<security_rolesystem_usergroupldap>`—User/group service obtained from an LDAP repository
  14. Other services can be added to GeoServer, such as that provided by the :ref:`AuthKey<authkey>` extension.
  15. .. _security_rolesystem_usergroupxml:
  16. XML user/group service
  17. ----------------------
  18. The XML user/group service persists the user/group database in an XML file. This is the default behavior in GeoServer. This service represents the user database as XML, and corresponds to this :download:`XML schema <schemas/users.xsd>`.
  19. .. note::
  20. The XML user/group file, :file:`users.xml`, is located in the GeoServer data directory, ``security/usergroup/<name>/users.xml``, where ``<name>`` is the name of the user/group service.
  21. The following is the contents of ``users.xml`` that ships with the default GeoServer configuration:
  22. .. code-block:: xml
  23. <userRegistry version="1.0" xmlns="http://www.geoserver.org/security/users">
  24. <users>
  25. <user enabled="true" name="admin" password="crypt1:5WK8hBrtrte9wtImg5i5fjnd8VeqCjDB"/>
  26. </users>
  27. <groups/>
  28. </userRegistry>
  29. This particular configuration defines a single user, ``admin``, and no groups. By default, stored user passwords are encrypted using the
  30. :ref:`weak PBE <security_passwd_encryption>` method.
  31. For further information, please refer to :ref:`configuring a user/group service <security_webadmin_usergroupservices>` in the :ref:`web_admin`.
  32. .. _security_rolesystem_usergroupjdbc:
  33. JDBC user/group service
  34. -----------------------
  35. The JDBC user/group service persists the user/group database via JDBC, managing the user information in multiple tables. The user/group database schema is as follows:
  36. .. list-table:: Table: users
  37. :widths: 15 15 15 15
  38. :header-rows: 1
  39. * - Field
  40. - Type
  41. - Null
  42. - Key
  43. * - name
  44. - varchar(128)
  45. - NO
  46. - PRI
  47. * - password
  48. - varchar(254)
  49. - YES
  50. -
  51. * - enabled
  52. - char(1)
  53. - NO
  54. -
  55. .. list-table:: Table: user_props
  56. :widths: 15 15 15 15
  57. :header-rows: 1
  58. * - Field
  59. - Type
  60. - Null
  61. - Key
  62. * - username
  63. - varchar(128)
  64. - NO
  65. - PRI
  66. * - propname
  67. - varchar(64)
  68. - NO
  69. - PRI
  70. * - propvalue
  71. - varchar(2048)
  72. - YES
  73. -
  74. .. list-table:: Table: groups
  75. :widths: 15 15 15 15
  76. :header-rows: 1
  77. * - Field
  78. - Type
  79. - Null
  80. - Key
  81. * - name
  82. - varchar(128)
  83. - NO
  84. - PRI
  85. * - enabled
  86. - char(1)
  87. - NO
  88. -
  89. .. list-table:: Table: group_members
  90. :widths: 15 15 15 15
  91. :header-rows: 1
  92. * - Field
  93. - Type
  94. - Null
  95. - Key
  96. * - groupname
  97. - varchar(128)
  98. - NO
  99. - PRI
  100. * - username
  101. - varchar(128)
  102. - NO
  103. - PRI
  104. The ``users`` table is the primary table and contains the list of users with associated passwords. The ``user_props`` table maps additional properties to a user. (See :ref:`security_rolesystem_usergroups` for more details.) The ``groups`` table lists all available groups, and the ``group_members`` table maps which users belong to which groups.
  105. The default GeoServer security configuration is:
  106. .. list-table:: Table: users
  107. :widths: 15 15 15
  108. :header-rows: 1
  109. * - name
  110. - password
  111. - enabled
  112. * - *Empty*
  113. - *Empty*
  114. - *Empty*
  115. .. list-table:: Table: user_props
  116. :widths: 15 15 15
  117. :header-rows: 1
  118. * - username
  119. - propname
  120. - propvalue
  121. * - *Empty*
  122. - *Empty*
  123. - *Empty*
  124. .. list-table:: Table: groups
  125. :widths: 15 15
  126. :header-rows: 1
  127. * - name
  128. - enabled
  129. * - *Empty*
  130. - *Empty*
  131. .. list-table:: Table: group_members
  132. :widths: 15 15
  133. :header-rows: 1
  134. * - groupname
  135. - username
  136. * - *Empty*
  137. - *Empty*
  138. For further information, please refer to :ref:`configuring a user/group service <security_webadmin_usergroupservices>` in the :ref:`web_admin`.
  139. .. _security_rolesystem_usergroupldap:
  140. LDAP user/group service
  141. ------------------------
  142. The LDAP user/group service is a read only user/group service that maps users and groups from an LDAP repository to GeoServer users and groups.
  143. Users are extracted from a specific LDAP node, configured as the ``Users search base``. Groups are extracted from a specific LDAP node, configured as the ``Groups search base``. A user is mapped for every matching user and a group is mapped for every matching group.
  144. It is possible to specify the attributes which contain the name of the group (such as ``cn``), the user (such as ``uid``) as well as the membership relationship between the two (such as ``member``). However, it is also possible to specify specific filters to search for all users/groups (for example ``cn=*``), find a user/group by name (for example ``cn={0}``) and map users to groups (such as ``member={0}``). These filters can also be automatically derived from the attribute names. Alternatively, the attribute names may be left empty if the filters are provided.
  145. For users, additional properties (key/value pairs, see :ref:`security_rolesystem_usergroups`) may be populated from the LDAP Server by providing a comma separated list of property names.
  146. Retrieving the user/group information can be done anonymously or using a given username/password if the LDAP repository requires it.
  147. An example of configuration file (config.xml) for this type of role service is the following:
  148. .. code-block:: xml
  149. <org.geoserver.security.ldap.LDAPUserGroupServiceConfig>
  150. <id>2c3e0e8d:154853796a3:-8000</id>
  151. <name>myldapservice</name>
  152. <className>org.geoserver.security.ldap.LDAPUserGroupService</className>
  153. <serverURL>ldap://127.0.0.1:10389/dc=acme,dc=org</serverURL>
  154. <groupSearchBase>ou=groups</groupSearchBase>
  155. <groupFilter>cn={0}</groupFilter>
  156. <groupNameAttribute>cn</groupNameAttribute>
  157. <allGroupsSearchFilter>cn=*</allGroupsSearchFilter>
  158. <groupSearchFilter>member={0}</groupSearchFilter>
  159. <groupMembershipAttribute>member</groupMembershipAttribute>
  160. <userSearchBase>ou=people</userSearchBase>
  161. <userFilter>uid</userFilter>
  162. <userNameAttribute>uid={0}</userNameAttribute>
  163. <allUsersSearchFilter>uid=*</allUsersSearchFilter>
  164. <useTLS>false</useTLS>
  165. <bindBeforeGroupSearch>true</bindBeforeGroupSearch>
  166. <user>admin</user>
  167. <password>admin</password>
  168. <passwordEncoderName>emptyPasswordEncoder</passwordEncoderName>
  169. <passwordPolicyName>default</passwordPolicyName>
  170. <populatedAttributes>email, telephone</populatedAttributes>
  171. </org.geoserver.security.ldap.LDAPUserGroupServiceConfig>
  172. For further information, please refer to :ref:`configuring a user/group service <security_webadmin_usergroupservices>` in the :ref:`web_admin`.