google.rst 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. Configure the Google authentication provider
  2. --------------------------------------------
  3. The first thing to do is to configure the OAuth2 Provider and obtain ``Client ID`` and ``Client Secret`` keys.
  4. #. Obtain OAuth 2.0 credentials from the Google API Console.
  5. Visit the `Google API Console <https://console.developers.google.com/>`_ to obtain OAuth 2.0 credentials such as a client ID and client secret
  6. that are known to both Google and your application. The set of values varies based on what type of application you are building.
  7. For example, a JavaScript application does not require a secret, but a web server application does.
  8. * Login with a valid Google Account
  9. .. figure:: images/google_api_console001.png
  10. :align: center
  11. * Click on ``APIs & Services``
  12. .. figure:: images/google_api_console002.png
  13. :align: center
  14. * Click on ``Credentials``
  15. .. figure:: images/google_api_console003.png
  16. :align: center
  17. .. note:: The first time you land here, Google will ask to create at least one project
  18. .. figure:: images/google_api_console004.png
  19. :align: center
  20. For the purpose of this tutorial we will create a sample project. You are free to create other projects or update existing ones through the `Google API Console <https://console.developers.google.com/>`_ later.
  21. .. figure:: images/google_api_console005.png
  22. :align: center
  23. If no ``Credentials`` are present, you will be asked to create new one.
  24. .. figure:: images/google_api_console006.png
  25. :align: center
  26. #. Select an existing (or create a new one) ``OAuth Client ID``
  27. .. figure:: images/google_api_console007.png
  28. :align: center
  29. #. Configure a new ``Web application``
  30. * If it is the first time you create an ``OAuth Client ID``, you will be asked to create a new ``consent screen``
  31. .. figure:: images/google_api_console008.png
  32. :align: center
  33. * Customize the ``consent screen``
  34. .. warning:: This step is mandatory only if it's the first time you are defining a ``Web application`` on a new project.
  35. If you don't have an organization, you can only choose type External from the screen below.
  36. .. figure:: images/google_api_console009.png
  37. :align: center
  38. * Fill the form below and click on ``save and continue`` untill all tabs are filled.
  39. .. figure:: images/google_api_console010.png
  40. :align: center
  41. .. note:: It can be edited and updated also later (see last point of this section below)
  42. * From the credentials page, click on ``CREATE CREDENTIALS``> ``OAuth Client ID`` and select ``Application type`` -> ``Web application``
  43. .. warning:: This step is mandatory only if it's the first time you are defining a ``Web application`` on a new project.
  44. .. figure:: images/google_api_console010a.png
  45. :align: center
  46. * Add a ``Name`` and the ``Authorized redirect URIs`` like shown here below.
  47. .. note:: This sample creates a client working on the default local URL ``http://localhost:8080/geoserver``. Of course this will work only on a local instance and can't be used for a production system.
  48. However it is possible to add as many ``Authorized redirect URIs`` you need to a new ``Web application``.
  49. It is also possible to create many ``Client credentials`` with customised ``consent screen`` and ``Web application``, depending on your specific needs.
  50. Every public GeoServer instance (or cluster of GeoServer belonging to a specific project) should have its own specific ``Client credentials``.
  51. .. figure:: images/google_api_console011.png
  52. :align: center
  53. .. note:: Always add two entries for each URI. One without the ending ``/`` and another one with it.
  54. .. figure:: images/google_api_console012.png
  55. :align: center
  56. #. Click on ``Create`` and take note of the ``Client ID`` and the ``Client Secret``.
  57. At the end of the procedure Google will show-up a small dialog box with the ``Client ID`` and the ``Client Secret``.
  58. That info can be always accessed and updated from the `Google API Console <https://console.developers.google.com/>`_
  59. .. figure:: images/google_api_console013.png
  60. :align: center
  61. #. Optionally customize the ``OAuth consent screen``.
  62. At any time it is possible to update and customize the ``OAuth consent screen``. You can put here your logo, app name, ToS and so on.
  63. .. figure:: images/google_api_console014.png
  64. :align: center