Log in with Google

LongSMM

Newbie
Joined
Jun 17, 2025
Messages
38
Reaction score
12
How to insert "log in with google" to you website?

Please show me step by step.

Thanks.
 

Step-by-Step: Add “Log in with Google” Button to Your Website​


Step 1: Create a Google Cloud Project​


  1. Go to the Google Cloud Console.
  2. Click “Select a project” > “New Project”.
  3. Name your project and click Create.



Step 2: Configure OAuth Consent Screen​


  1. In the left sidebar, go to APIs & Services > OAuth consent screen.
  2. Choose External if the app is for general public, or Internal if it's only for your organization.
  3. Fill in the required fields (app name, user support email, etc.).
  4. Save and continue through the scopes (leave default if unsure).



Step 3: Create OAuth 2.0 Credentials​


  1. Go to APIs & Services > Credentials.
  2. Click Create Credentials > OAuth 2.0 Client ID.
  3. Select Web application.
  4. Under Authorized JavaScript origins, add your site’s origin (e.g., https://yourdomain.com).
  5. Under Authorized redirect URIs, add your redirect URI (e.g., https://yourdomain.com/auth-callback).
  6. Click Create and copy the Client ID.

✅ Step 4: Add Google Sign-In Script to Your HTML
 
To add "login in with google" to your website, you need to create a client ID through Google's developer tools, enable the login script and button and add the login script and button to your site using the provided documentation.
 
You can use AI to learn and implement it. Ask to chatgpt, Claude... And you will have the answer and the steps to implement it
 
Do you already have a backend framework ready Node, PHP, whatever. The implementation depends on what tech stack your using. But generally it GGOAuth 2.0, setup a client ID, add the redirect, and verify the token server side. Drop what stack you’re on and I can help you step by step.
 

Step-by-Step: Add “Log in with Google” Button to Your Website​


Step 1: Create a Google Cloud Project​


  1. Go to the Google Cloud Console.
  2. Click “Select a project” > “New Project”.
  3. Name your project and click Create.



Step 2: Configure OAuth Consent Screen​


  1. In the left sidebar, go to APIs & Services > OAuth consent screen.
  2. Choose External if the app is for general public, or Internal if it's only for your organization.
  3. Fill in the required fields (app name, user support email, etc.).
  4. Save and continue through the scopes (leave default if unsure).



Step 3: Create OAuth 2.0 Credentials​


  1. Go to APIs & Services > Credentials.
  2. Click Create Credentials > OAuth 2.0 Client ID.
  3. Select Web application.
  4. Under Authorized JavaScript origins, add your site’s origin (e.g., https://yourdomain.com).
  5. Under Authorized redirect URIs, add your redirect URI (e.g., https://yourdomain.com/auth-callback).
  6. Click Create and copy the Client ID.

✅ Step 4: Add Google Sign-In Script to Your HTML
Thanks, I got it done already. really helpful
 
First, you’ll need to create a Google API project and enable its OAuth consent flow. Go to the Google Cloud Console, create a new project, then under “APIs & Services” click “OAuth consent screen.” Fill in the basic app information (name, logo, support email) and add your domain under “Authorized domains.” Once that’s saved, head to “Credentials” and choose “Create credentials → OAuth client ID.” Select “Web application,” give it a name like “My Site Sign-In,” and under “Authorized JavaScript origins” add your site’s URL (for example https://example.com). In “Authorized redirect URIs” put whatever endpoint on your server will handle Google’s callback, e.g. https://example.com/auth/google/callback. Save, and note the Client ID and Client Secret.
 
Back
Top