Configuring external login providers within Plato eases the sign-up or account creation process for your end users. This can encourage participation as users don't need to create yet another web account and instead can use there preferred login provider to automatically sign-in to Plato.
In this article we'll demonstrate the steps necessary to allow your users to login to your Plato installation using there existing Google account.
To allow users to login to Plato via Google you'll first need to enable the Plato Authentication Google module. This module is provided with Plato 1.0.7 and above. To enable this module visit your Plato Features page and type Google into the search box along the top.
Within the list of results you'll see Plato Authentication Google. Click the Enable button to the right of the Plato Authentication Google result to enable this module.
Once Plato Authentication Google is enabled you'll notice a new Google link appears under Settings on the left within the Plato dashboard navigation. From the new Settings > Google page you can now enter the client ID & client secret necessary to allow your users to login to Plato using Google.
Obtain your Client ID & Client Secret from Google
Click the "Configure a Project" button as highlighted below...
From the Configure a Project dialog select "Create a new project" and enter a name for your project. This name will only be visible to you and is used to identify your project within Google.
If your creating a new project you will be prompted to provide a product name. This is the name that will be displayed to end users when they login via Google from your Plato installation.
On the Configure your OAuth Client page select "Web Server" and enter the domain for your Plato installation plus /signin-google. For example our domain is https://plato.instantasp.co.uk so the URL we enter here is https://plato.instantasp.co.uk/signin-google. This is shown below...
IMPORTANT It's important the authorized redirect URIs is configured correctly for the oAuth 2.0 flow to work correctly. If your Plato installation is located at say https://www.company.com/ then the redirect URL must be https://www.company.com/signin-google.
After you've completed these steps you will be presented with your Google Client ID & Client Secret as shown below. You will need to copy each of these keys into Plato as detail in the next section...
Add your Google Client ID & Client Secret into Plato
Once you have both the Client ID & Client Secret provided by Google for your project navigate to the Plato dashboard and click Settings on the left. Then click Google. From here paste in your Google Client ID and Client Secret as shown below...
Save your Google settings.
TIP If you used
/signin-googlefor your authorized redirect URI when configuring the project within Google you can leave the Callbank Path field empty within Plato. This field only needs to be completed if you provide a redirect URI for your Google project other than
Testing Google Login
After entering the Google Client ID and Client Secret into the Google Settings page within Plato and saving your changes you should notice a new option appear on your Plato login page that will allow users to login via Google. You can see this below...
You can use the Login with Google button to test your Google login flow.
We hope this article helped you configure Google Sign-In within Plato. Should you encounter any issues or have any questions please don't hesitate to post within our Q&A area and we will assist as quickly as possible.