C# – First steps with C# and .NET – part 059.

By | 19/09/2022

In this tutorial, I will show you how to use Google authentication with a JSON file from Google.
First, you need to create a google project in the google dashboard area.
Create a new folder and rename it like Google001Quickstart.
You need to add an A.P.I. to your project, like Google Drive A.P.I., and on the credentials download the JSON file into your project folder named Google001Quickstart and I renamed into client_secret.json.
I start with a new console project in this folder and I add these packages:

After some testing with the source code, I need to use the Visual Studio 2022 I.D.E. because this will fix some errors and add some new packages to my source code.
The source code I used is simple to understand if you know the basics of the Google authentication process and a little bit of C#.
When I run it this source code will make only the authentication with the browser and show the console message from the source code.
Let’s see this source code:

The next step is to create a service for this and use the Google A.P.I. but this will be an issue for the next tutorial.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.