configuration.rst 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. .. _geofence_configuration:
  2. GeoFence Admin GUI
  3. ==================
  4. The GeoFence Admin Page is a component of the GeoServer web interface. You can access it from the GeoServer web interface by clicking the :guilabel:`GeoFence` link, found on the left side of the screen after logging in.
  5. .. figure:: images/configuration.png
  6. :align: center
  7. General Settings
  8. ----------------
  9. Configure the following settings here:
  10. - GeoServer instance name: the name under which this GeoServer is known by the GeoFence server. This is useful for when you use an external GeoFence server with multiple GeoServer servers.
  11. - GeoServer services URL: this is how GeoServer knows how to connect to the external GeoFence server. When using an internal GeoFence server, this is not configurable. For example "http://localhost:9191/geofence/remoting/RuleReader" for an external GeoFence server on localhost.
  12. Options
  13. -------
  14. Configure the following settings here:
  15. - Allow remote and inline layers in SLD
  16. - Authenticated users can write
  17. - Use GeoServer roles to get authorizations
  18. - Disabled: For each authorization request, GeoServer sends only the user info to GeoFence.
  19. GeoFence will retrieve all the roles associated with the user, and will merge
  20. the permissions granted for each role.
  21. - Enabled: For each authorization request, GeoServer sends to GeoFence the user info AND the roles assigned in the current request session.
  22. GeoFence will retrieve all the roles associated to the user, and will only consider the requested roles
  23. that are really associated to the user.
  24. - Comma delimited list of mutually exclusive roles for authorization
  25. - This field is mandatory when the previous option is enabled.
  26. GeoServer will send to GeoFence the roles in the current request session which match the entries in this list.
  27. You can use the '*' symbol to match any session role.
  28. When using "*", you can use the format "`-ROLENAME`" to exclude one or more roles from the session roles list.
  29. Cache
  30. -----
  31. Configure the following settings here:
  32. - Size of the rule cache (number of entries)
  33. - Cache refresh interval (ms)
  34. - Cache expire interval (ms)
  35. Collected data about the cache can be retrieved here. Per cache (rules, admin rules and users) we retrieve the cache size, hits, misses, load successes, load failures, load times and evictions. The cache can be manually invalidated (cleared).
  36. Basic GeoServer configuration
  37. -----------------------------
  38. - Login with the default administrative credentials ``admin / geoserver`` (or whatever you have configured before).
  39. .. figure:: images/basic_001.png
  40. :align: center
  41. - In the security panel you'll find the GeoFence link to the GeoFence security admin page
  42. .. figure:: images/basic_002.png
  43. :align: center
  44. - Open the GeoFence admin page; you'll get to this page:
  45. You can notice here the information that allow the GeoFence probe inside GeoServer to communicate with the GeoFence engine:
  46. - the URL that the probe shall use to communicate with GeoFence;
  47. - the name (default is `default-gs`) this instance will use to identify itself to GeoFence. This instance name should be equal to the one we set into GeoFence.
  48. - Testing connection to GeoFence.
  49. We already performed a connection test from GeoFence to GeoServer. Using the button **Test connection** we can also test that GeoServer can communicate to GeoFence. If everything is ok, you'll get this message:
  50. .. figure:: images/basic_003.png
  51. :align: center
  52. - Open the **Authentication** page under the **Security** settings:
  53. .. figure:: images/basic_004.png
  54. :align: center
  55. - Add the GeoFence authenticator and **put it as the first in the list** otherwise you will not be able to login as ``admin/admin``:
  56. .. figure:: images/basic_005.png
  57. :align: center
  58. - Now that we added GeoFence as authentication provider, we'll be able to log into GeoServer using the credentials we added in GeoFence (user ``admin`` and user `tiger`). Try and log in using user ``tiger``.
  59. Testing authorization
  60. ---------------------
  61. - Logging into GeoServer as admin you will be able to see all the defined layers:
  62. .. figure:: images/basic_006.png
  63. :align: center
  64. - Logging into GeoServer as a non-admin user, the defined rules will be examined; since we defined no rules yet, the default behaviour is to deny access to all resources:
  65. .. figure:: images/basic_007.png
  66. :align: center
  67. - Get back to GeoFence, and add a rule which allows all layers in workspace tiger for user ``tiger``; create a rule defining:
  68. - user ``tiger``
  69. - instance ``default-gs``
  70. - workspace ``tiger`` (you will get a dropdown menu containing all the workspaces available in the selected instance)
  71. - grant type: ``allow`` You'll get a line like this one:
  72. .. figure:: images/basic_008.png
  73. :align: center
  74. - Verify the new authorizations.
  75. Since the probe caches the GeoFence responses, you may need to login again as administrator (or you may keep an admin session open in another browser) and clear the probe cache. You can do it by pressing the "Invalidate" button in the bottom of the GeoFence admin page:
  76. .. figure:: images/basic_009.png
  77. :align: center
  78. - Login again in GeoServer as user tiger and you will see in **layer preview** all the layers in the ``tiger`` workspace:
  79. .. figure:: images/basic_010.png
  80. :align: center