Login with Google Authentication in WebApp

Now we can use Google Authentication service in our web application, it saves lots of time, help reducing risk of fake user profile creation with highly secure way.

Let's understand how to implement Authentication using Google Identity service.

add Google Authentication in asp.net website

To configure your application for using Google identity service, let’s open the url
Old url https://console.developers.google.com/apis/credentials/consent
and new url https://console.cloud.google.com/apis/credentials

There are different type of authentication service available in Google authentication api.

  • Sign In With Google
  • One-tap sign-up
  • Automatic sign-in

Configure Google API Service

First we need to login to above url for configuring our application in google console.

Once you log into the console panel, you need to go to flowing section to setup your application, credential and verify domain.

API: API & Services

  • Dashboard
  • Library
  • Credentials
    Select Create Credentials => OAuth Client Id
    This will allow creating a "Client ID" and "Client secret key" for your specified domain, in the application type you can select different type of application. [in this example, we are creating for web application]
  • OAuth Consent Screen
  • Domain Verification
    You must perform domain verification, to let google know that you are the owner of that domain.
  • Page usage agreement

Open your asp.net application to configure oAuth

Now, open your asp.net application configuration file and add oauth client key and value with some keys, so we can retrieve in code and use it.

<add key="GoogleOAuthClientId" value="long-id.apps.googleusercontent.com" />
<add key="GoogleOAuthClientSecret" value="secret-value" />

Or, if you are using asp.net core application, you need to write the configuration info into appsettings.json file.

"GoogleOAuth": {
    "ClientID": "long-id.apps.googleusercontent.com",
    "ClientSecret": "secret-value"
  }
You may be interested to read following posts
Good to Read
You may also read
What is Page Authority in SEO! How does it work?
Page Authority in SEO
Best web designing technologies and best practice
web designing technologies
Email marketing strategy and tools for small business
Email marketing strategy and tools for small business