configuration.rst 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. .. _webserviceauth_configuration:
  2. HTTP Based Authorization configuration
  3. ======================================
  4. The ``HTTP Based Authorization plug-in`` will try to authenticate the user on an configured external authentication service.
  5. The username and the password will be sent to the service in one of the following ways:
  6. * In a Header named ``X-HTTP-AUTHORIZATION``.
  7. * As a query parameters or as request path. For this use case the url needs to be configured by inseritng two placeholder, namely ``{user}`` and ``{password}`` , where the username and password are expected to be provided eg. ``https://my-auth-service?username={username}&password={password}``.
  8. The Authentication Provider will perform a ``GET`` request, sending credential Base64 encoded. If the response status returned by the external service is different from ``200`` the user will not be authenticated.
  9. In case the external authentication service is returning the authenticated user's roles in the response body, it is possible to define a regular expression to extract them, allowing for their usage for authorization. There is no limitation to a specific content type.
  10. Once the plug-in is installed, it can be configured by:
  11. * Opening the *Authentication* option in the *Security* menu
  12. * Choosing *Authentication provider* and then *add new*.
  13. * Choose the ``Web Service Authentication`` option
  14. .. figure:: images/newProvider.png
  15. Clicking on ``Web Service Authentication`` offers the possibility to enter the provider settings.
  16. .. figure:: images/httpProviderConf.png
  17. Where:
  18. * ``Service URL`` is the URL of the external service meant to be used for authentication.
  19. * ``Timeout`` is the connection timeout.
  20. * ``Read Timeout`` is the timeout on waiting to read response data.
  21. * The ``Send credentials in X-HTTP-AUTHORIZATION Header`` checkbox is meant to be flagged if credentials have to be sent through the authorization header. If unchecked (default) GeoServer expects to find placeholders for username and password as ``{user}`` and ``{password}`` in the provided URL instead.
  22. * The ``Allow HTTP connection`` checkbox if flagged will allow authentication request to be performed toward an external service that uses ``HTTP`` protocol. By default only ``HTTPS`` is allowed.
  23. * In the ``Authorization`` section the radio button allows to define whether to use a GeoServer ``RoleService`` to read roles or if roles are meant to be returned by the external authentication service.
  24. * In case ``Read Roles from Web Response`` is chosen, a regular expression to extract the roles from the authentication service response needs to be provided.
  25. Once the settings are saved the new ``AuthenticationProvider`` is added to the list and needs to be added into the list of the providers' chain
  26. .. figure:: images/providersList.png