Having a flexibility of creating a login logic can have many benefits to enjoy your self logic on to the application for authorization. So today here we will get the idea of going through Google Authentication in a .Net Core Application on a step wise process.

Note: The demonstration does not contains full application scenario (Complete Application) but have all the basic details needed which can be used to handle the details with self logic for your application needs.

Part 1 : Google Console Setup

First we need to have Google Client Id And Google Client Secret so for the purpose,

Login To Google Console and create a new New Project as

Now we need to enter a project name so as to distinguish each application, the organization field can be left as it is if you don’t want to have any organization.

Now, we need to move to Credentials menu as per the image below

Since we are creating an application for the first time we need to Configure Consent Screen which will be displayed when user chooses to login through Google.

Now, once we click on the button the below screen is displayed not choose External since the application is for any external users and click on Create.

Now, we need to enter a App Name and support and developer email address to create an app, the app creation and its use is shown below

Now, since we are doing the work with minimum configuration we can save and continue until the last, if you want to explore more every step will be presented with very descriptive details on the portal itself.

Here the app creation concludes now we need to move to credentials menu and create a OAuth Client ID as per the image below

Now we need to configure by choosing Application Type as Web Application and a client name as in the image below. Now Authorized Redirect URLs are the URL used for the redirection of the Google Authentication after success or failed attempt. The URL must be application URL. Since we are using ta local application we have used local urls.

Once clicked on Create we will be presented with the Client Id and Client Secret Id

Now we have completed the setup part on the Google Portal and have got the required

  1. Client Id
  2. Client Secret

#.net core #asp.net core 3.1 google authentication #asp.net core 3.x google authentication #asp.net core 5 google authentication

Adding Google Authentication In .Net Core Application Without Identity The Basics
2.50 GEEK