Angular 11 Google OAuth Social Login Example Tutorial

In this tutorial you will learn about the Angular 11 Google OAuth Social Login Example Tutorial and its application with practical example.

In this Angular 11 Google OAuth Social Login Example Tutorial I will show you how to create Google social login in angular. In this tutorial you will learn to build fully functional google login using Google OAuth Client ID or Google API in angular application. In this example we will be using angularx-social-login library to implement google login in angular.

Angular 11 Google OAuth Social Login Example Tutorial

In this step by step tutorial I will demonstrate you to build Google OAuth Social Login in angular application. Please follow the instruction given below:

  • Step 1: Create Angular Project
  • Step 2: Get OAuth Client ID
  • Step 3: Install Angular Social Login Library
  • Step 4: Implement Google OAuth Signin
  • Step 5: Test Login with Google.

Create Angular Project

First of all we need to make sure to have Angular CLI installed on your system:

Now, we need to create a fresh angular project, Create the angular application using the below command

Now, switch to the project directory:


Next, we will install Bootstrap package in our project. Now run the following command to install bootstrap package:

Add the Bootstrap main CSS in the styles array as shown here:

Create Google App

In this step we will obtain the client id to create the signin with google in angular.

  • Step 1: Visti the  Google Developer Console and follow the suggested process:
  • Step 2: On the google developer console, click on the “create project” button to create auth API.
  • Step 3: On the New Project screen, you need provide the project name along with any required information. Click on the CREATE button.
  • Step 4: Now, go to the OAuth consent screen, choose the External option. This will help you choose to configure and register Google auth API for specific users.
  • Step 5: Now, you need to provide application home page url, application privacy policy link, application terms of service link, or other mandatory details.
  • Step 6: After that, a form will be appear. Please select Web application from application type options. Once you have select Web application option, then one form will appear on web page. Here you have to define Name and you have also define Authorized redirect URIs field and lastly click on Create button.
  • Step 7: Lastly, OAuth client screen will appear, from here you can get your Client ID and your client secret key.

Install Angularx Social Login Package

Now, open the console then run following command to install the angularx-social-login package.

Next you need to set the google client id inside the GoogleLoginProvider() method.

Open and add the given code in app.module.ts file:

Implement Google OAuth Signin in Angular

Open and update below code in app.component.html file:


Add the following code in app.component.ts file:

Test Angular Login with Google

Check out the demo app with following url:

In this tutorial we have learn about the Angular 11 Google OAuth Social Login Example Tutorial and its application with practical example. I hope you will like this tutorial.