Integrate Google Login

This guide will cover how to set up your Google Login for custom authentication provider.

Setup Google OAuth

  1. Follow the official Google Cloud documentation to obtain OAuth2 credentials with the ‘Web Client’ application type. This step might require KYC with Google Cloud.

  2. 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.

example of what the console will look like after adding the needed urls

  1. After clicking create, save the client and secret keys. Download and back up the JSON file provided.

Configure Authentication Provider

  1. Under the project settings, navigate to the Authentication section.

  2. Select Google from the list of providers.

  3. Fill in the Client ID and Client Secret fields with the values from the Google Cloud Console.

  4. Toggle the Enable switch to enable Discord Login.

  5. Click on the Save changes button.

Test Google Login

  1. Go to your application and connect wallet.

  2. Click on the Login with Google button.

  3. You will be redirected to the Google login page.

  4. Login with your Google account.

  5. You will be redirected back to your application.

  6. You have successfully integrated Discord Login with your application.