Integrate Google Login
This guide will cover how to set up your Google Login for custom authentication provider.
Setup Google OAuth
-
Follow the official Google Cloud documentation to obtain OAuth2 credentials with the ‘Web Client’ application type. This step might require KYC with Google Cloud.
-
While in the oauth2 application console, under ‘Authorized JavaScript Origins’, add https://web3.meshjs.dev & under ‘Authorized Redirect URLs’, add https://web3.meshjs.dev/api/auth.
- After clicking create, save the client and secret keys. Download and back up the JSON file provided.
Configure Authentication Provider
-
Under the project settings, navigate to the Authentication section.
-
Select Google from the list of providers.
-
Fill in the
Client ID
andClient Secret
fields with the values from the Google Cloud Console. -
Toggle the Enable switch to enable Discord Login.
-
Click on the Save changes button.
Test Google Login
-
Go to your application and connect wallet.
-
Click on the Login with Google button.
-
You will be redirected to the Google login page.
-
Login with your Google account.
-
You will be redirected back to your application.
-
You have successfully integrated Discord Login with your application.