Bacancy Bacancy
  • Our Engagement Models

    We offer flexible engagement models tailored to your project scope and timeline.

    Software Development Outsourcing
    Staff Augmentation
    Dedicated Teams
    Engagement Models

    High-Quality, Affordable IT Outsourcing

    Explore All Services

    AI & ML

    • AI Strategy & Roadmap
    • AI Development
    • Generative AI
    • AI Agent Development
    • Machine Learning
    • Computer Vision
    • LLM Development
    • RAG Development

    Data

    • Data Engineering
    • Data Analytics & BI
    • Data Science
    • Data Warehouse
    • Data Lake
    • Data Governance

    Cloud

    • Cloud Consulting
    • Cloud Migration
    • AWS Services
    • Azure Services
    • GCP Services
    • Kubernetes
    • DevOps

    Product Engineering

    • Full Stack Development
    • Custom Software Development
    • SaaS Development
    • App Modernization
    • Mobile App Development
    • Web Development
    • UI/UX Design

    Platforms

    • Salesforce
    • SAP
    • ServiceNow
    • Microsoft Dynamics
    • Snowflake
    • Databricks
  • Why Bacancy

    14+ years building domain-specific products for regulated and high-growth industries worldwide.

    Global delivery, every time zone

    Global delivery, every time zone

    1050+ vetted engineers

    1050+ vetted engineers

    Onboard in 48 hours

    Onboard in 48 hours

    Explore Our Case Studies

    Industries

    • Healthcare
    • Finance
    • eCommerce
    • Logistics
    • Fintech
    • Real Estate
    • Education
    • Insurance
    How Bacancy Built a Custom Epic EHR Solution to Automate Clinical Workflows

    How Bacancy Built a Custom Epic EHR Solution to Automate Clinical Workflows

    Read case study
  • About.

    1050+ world-class tech experts. One standard: customer satisfaction.

    About Company

    About Company

    • About Us
    • Leadership Team
    • Customer Reviews
    • Infrastructure
    • Our Locations
    • Partnership

    Resources

    • Press Room
    • Blog
    • Insights
    ISO/IEC 27001:2022 Certified

    ISO/IEC 27001:2022 Certified

    Built for enterprise security and compliance.

    Get Quote
  • Technologies
  • Customer Stories
  • Contact Us
Find a Developer
book a 30 min call
  • AI Strategy & Roadmap
  • AI Development
  • Generative AI
  • AI Agent Development
  • Machine Learning
  • Computer Vision
  • LLM Development
  • RAG Development
  • Data Engineering
  • Data Analytics & BI
  • Data Science
  • Data Warehouse
  • Data Lake
  • Data Governance
  • Cloud Consulting
  • Cloud Migration
  • AWS Services
  • Azure Services
  • GCP Services
  • Kubernetes
  • DevOps
  • Full Stack Development
  • Custom Software Development
  • SaaS Development
  • App Modernization
  • Mobile App Development
  • Web Development
  • UI/UX Design
  • Salesforce
  • SAP
  • ServiceNow
  • Microsoft Dynamics
  • Snowflake
  • Databricks
  • Healthcare
  • Finance
  • eCommerce
  • Logistics
  • Fintech
  • Real Estate
  • Education
  • Insurance
  • About Us
  • Leadership Team
  • Customer Reviews
  • Infrastructure
  • Our Locations
  • Partnership
  • Press Room
  • Blog
  • Insights

Technologies

Customer Stories

Contact Us

Find a Developer
book a 30 min call
Google social login

Angular 11 Google Social Login or Sign In Tutorial using angularx-social-login

Aishwary Rawat
Aishwary Rawat Director of Engineering
Last Updated on March 10, 2025 | Written By: Aishwary Rawat

Table of Content

▣ Introduction

▣ Goal of Google Social Login tutorial

▣ Steps to Implement Google Social Login

▣ Steps to Integrate Google Social Login with Angular 11 Application using angularx-social-login

▣ Conclusion

Introduction

In this tutorial, we will learn how to implement the Google Social Login using the angular-social-login library available in Angular. You can implement this approach for Angular 9+. Older versions of Angular require a slight change in some of the code (particularly in the module.ts file).

With the help of Social login, you can access or sign in to the third-party app without creating a new login account and using your current Google/Twitter/Facebook accounts. Here we would only discuss Google Social Login.

You might like to visit the How to Integrate Google and Facebook Authenticate Using Angular 8 tutorial.

Goal of Google Social Login Tutorial

Before learning how to implement Google Social Login with Angular 11 Application. Let’s see this video to ensure the takeaway from this tutorial.

Steps to implement Google Social Login

Here we will build a demo application together and focus on implementing Google Social Login using the Angular 11 app with the help of a Google developer account and angularx-social-login plugin.

We need to have client id and secret from our project on Google Developer Console to implement Google Social Login in Angular 11. If you don’t have these or are unaware of the steps to get the follow these instructions:

Step 1: Open Google Developer console

First of all, head towards the Google Developer Console and use your Google credentials to log in there.

Step 2: Select a project.

In this step, we will select our project. It’s totally up to you whether you want to work with an existing project or start afresh and create a new project.

Select a project
Select a project.

Step 3: Click the CREATE button.

If you want to create a new project, the hit the Create button and enter the details asked.

Click the CREATE button to create a new project

Step 4: Now go to the OAuth consent screen

It’s time to move towards the OAuth consent screen; for that, click on External from the sidebar at the left. You will be able to see the OAuth consent screen if you have a google account. Hit on CREATE.

OAuth consent screen

Step 5: Application set-up

Here in this step, write your application’s name. The name you entered will be visible on the OAuth consent screen. Some of the additional fields like –

  • Application Homepage
  • Authorized domain link
  • Privacy policy link
  • Terms of Service link.

should be hosted on an Authorized domain.

After providing these fields, they will also be visible on the OAuth consent screen. Once done, hit the Save button.

Application set-up

Step 6: Create Credentials

Now further, click on the Create Credentials and choose OAuth client ID from the given options.

Create Credentials and choose OAuth client ID

Step 7: Create OAuth Client ID

The below form will appear. From the Application Type options, select Web application.

Define Name and Authorised Javascript Origins (Here, I am running my application on localhost:4200).
Lastly, click on the Create button.

Create OAuth Client ID

Step 8: Your Client Id and Your Client Secret

A modal pop-up containing Your Client Id and Your Client Secret appears. Save it for later use.

Your Client Id and Your Client Secret

Note: If you change your authorized JavaScript origin (say, to localhost:4100), don’t forget to add it to the Authorized JavaScript Origins list; otherwise, you will receive a runtime error.

runtime error

So now we have Client Id and Client Secret. It’s time to integrate Google Social Login with our Angular application.

Are you looking for skilled Angular developers to work on your project?
Prepare to have your struggle reduced! Hire Angularjs developer from Bacancy today and begin working on your dream product! We are here to help!

Steps to Integrate Google Social Login with Angular 11 Application using angularx-social-login

Follow these steps to integrate your application with Google Social Login.

Step 1 : Create a new Angular app

Create a new Angular application by executing the below command in your terminal-

ng new GoogleSocialLogin

Step 2 : Generate a new component

Use this command to generate a new component named Login-

ng g c login 

Step 3 : Install angularx-social-login and bootstrap.

Install the NPM package called angularx-social-login and bootstrap library for implementing the google social login in our angular app.

npm install --save angularx-social-login

Step 4 : Open the app.module.ts file.

Open app.module.ts file.

Import these modules from angularx-social-login

  • ReactiveFormsModule
  • SocialLoginModule
  • SocialAuthServiceConfig
  • GoogleLoginProvider

Also, inject these modules in imports as well as inside the providers’ array.

Add YOUR-GOOGLE-CLIENT-ID in the following code.

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from "@angular/forms";
import { AppComponent } from './app.component';
import { LoginComponent } from './GoogleSocialLogin/login.component';
import { SocialLoginModule,SocialAuthServiceConfig } from "angularx-social-login";
import { GoogleLoginProvider } from "angularx-social-login";
import { environment } from 'src/environments/environment';
 
const CLIENT_ID = environment.client_Id;
@NgModule({
  declarations: [AppComponent, LoginComponent],
  imports: [BrowserModule, FormsModule, SocialLoginModule],
  providers: [
    {
      provide: "SocialAuthServiceConfig",
      useValue: {
        autoLogin: true,
        providers: [
          {
            id: GoogleLoginProvider.PROVIDER_ID,
            provider: new GoogleLoginProvider(
              CLIENT_ID
            )
          }
        ]
      } as SocialAuthServiceConfig
    }
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Step 5 : Open login.component.html file and add the below code.

login component

Step 6 : the Open login.component.ts

Update the login.component.ts file with the below code for integrating Google Social Login into your angular app.

import { Component, OnInit } from '@angular/core';
import { SocialAuthService } from "angularx-social-login";
import { SocialUser } from "angularx-social-login";
import { GoogleLoginProvider } from "angularx-social-login";
@Component({
  selector: 'app-login',
  templateUrl: './login.component.html',
  styleUrls: ['./login.component.css']
})
export class LoginComponent implements OnInit {
   public user: SocialUser = new SocialUser;
   	constructor(private authService: SocialAuthService) {}
ngOnInit() {
      this.authService.authState.subscribe(user => {
      this.user = user;
      console.log(user);
    });
  }
  public signInWithGoogle(): void {
    this.authService.signIn(GoogleLoginProvider.PROVIDER_ID);
  }
  public signOut(): void {
    this.authService.signOut();
  }
}

Step 7 : Start the development server to test the application.

Run this command and test your application-

ng serve

You should see a screen with a google login button.

Conclusion

So, this was all about how to integrate Google Social Login with the Angular 11 application. I hope the purpose of this tutorial has been served the way you expected. If you wish to explore more about Angular, then visit AngularJS tutorials. Our team has specially designed the Angular tutorials for beginners and experienced developers. I believe you don’t want to miss such an opportunity!

Contact Bacancy Technology and hire Angular developer for satisfying your project requirements. Bacancy has versatile, enthusiastic, and dedicated Angular developers! Without any delay, connect with us!


Expand Your Digital Horizons With Us.

Start a new project or take an existing one to the next level. Get in touch to start small, scale-up, and go Agile.


Or
E-mail us : solutions@bacancy.com

Your Success Is Guaranteed !

Related Articles

Dhara Shah

June 4, 2026

AngularJS

Angular 22 Features: What’s New, What Breaks, and Should You Upgrade?

By : Dhara Shah

Angular released v22 on June 3, 2026. The latest Angular version announced Signal Forms, Resource APIs, and Angular Aria are...

Read More
Dipal Bhavsar

November 21, 2025

AngularJS

Angular 21: Latest Features, Updates & Advancements

By : Dipal Bhavsar

Read More
Dipal Bhavsar

November 3, 2025

AngularJS

7 Easiest Ways to Use AI in Angular

By : Dipal Bhavsar

Read More

Offices and Development Centers

Bacancy Ahmedabad Ahmedabad

15-16, Times Corporate Park, Thaltej, Ahmedabad, 380059

Bacancy Gandhinagar Gandhinagar

422-A, 4th Floor, Pragya Tower Road 11, Block 15, Zone 1, SEZ-PA Gandhinagar, 382355

Bacancy Hyderabad Hyderabad

Awfis, Level 1, N Heights, Plot No 38, Phase 2, Hitech City Hyderabad, 500081

Bacancy Mumbai Mumbai

18th Floor, Cyberone, opp. CIDCO Exhibition Centre, Sector 30, Vashi, Navi Mumbai, 400703

Bacancy Pune Pune

2nd FloorMarisoft-1, Marigold IT Park, Pune - 411014

Bacancy Bengaluru Bengaluru

Raheja Towers, 26/27, Mahatma Gandhi Rd, East Wing, Craig Park Layout, Ashok Nagar, Bengaluru, 560001

Global Presence

Bacancy New Jersey New Jersey

33 South Wood Ave, Suite 600, Iselin NJ 08830

Bacancy California California

535 Mission St 14th floor, San Francisco, CA 94105

Bacancy Massachusetts Massachusetts

501 Boylston St, Boston, MA 02116

Bacancy Florida Florida

4995 NW, 72nd Avenue, Suite 307, Miami, FL, 33166

Bacancy London London

90 York Wy, London N1 9AG, United Kingdom

Bacancy Ontario Ontario

71 Dawes Road, Brampton, On L6X 5N9, Toronto

Bacancy Australia Australia

351A Hampstead Rd, Northfield SA 5085

Bacancy UAE UAE

One Central 8th and 9th Floor - Trade Centre - Trade Centre 2 - Dubai - United Arab Emirates

Bacancy Sweden Sweden

Junkergatan 4, 126 53 Hagersten

Get in Touch

Great Place to Work

Get in Touch

cal-icon

Looking for expert advice?

Schedule a Expert Call


  • Brochure
  • Quality Assurance
  • Resources
  • Tutorials
  • Customer Reviews
  • Privacy Policy
  • FAQs
  • Press Room
  • Contact Us
  • Sitemap
  • Employee

bacancy google review 4.6
bacancy google review
bacancy clutch review 4.8
bacancy clutch review
bacancy glassdoor review 4.5
bacancy glassdoor review
bacancy goodfirms review 4.8
bacancy goodfirms review
iso
  • Bacancy Behance
  • Bacancy Pinterest

Copyright © 2026 BACANCY SERVICES PRIVATE LIMITED All rights reserved.