How to integrate Google Sign-in?
Last update: 05/Nov/2024
1. Google Developer Console
First of all, Goto Google developer console and create a project.
https://console.developers.google.com/projectcreate
2. Select OAuth Client ID
After creation of project. make sure that you've selected the created project. Goto credentials page https://console.developers.google.com/apis/credentials Click on the create credentials and select OAuth ClientID.
3. Configure Consent Screen
Configure Consent Screen. Select Internal as User Type and External as Application Type. Then, click Save.
3. Get Client ID & Client Secret
Copy both the generated Client ID & Client Secret.
4. Add Redirect URI
Finally, add your domain URL in the Authorised redirect URIs box on the google credentials page. Also it must be end with /sign-in-with-google
Eg. https://YOUR-DOMAIN.com/sign-in-with-google
Paste the Redirect URI in the field. Then, click Save.
5. Update ClientID and Client Secret via admin panel
Go to Settings -> General Settings -> Webtools and Google Configuration Settings
and update your ClientID and Client Secret and keep your Google Auth Enable as ON click on update changes.
6. Update ClientID and Client Secret via .env (Optional)
Login to your cpanel or any control panel and goto file manager.
PROJECT-ROOT/.env
you can find the .env
file. Open the file and update the values and save it.
7. No need of Google Sign-in (Optional)
Go to Settings -> General Settings -> Webtools and Google Configuration Settings
and update your Google Auth Enable as OFF.