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.
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.
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
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" }