This project is an ASP.NET API that implements OAuth 2.0 authentication using Google .
It allows users to log in to the system using their Google account securely.
To use this project, you need to create your own Google Client ID and Client Secret. Follow these steps:
- Go to the Google Cloud Console.
- Create a new project or select an existing one.
- Navigate to APIs & Services > Credentials.
- Click on Create Credentials and choose OAuth 2.0 Client IDs.
- Configure the consent screen and add your application details.
- Set the Redirect URI to match your API endpoint (e.g.,
http://localhost:5000/api/auth/callback
). - Copy the generated Client ID and Client Secret.
- Add them to your
appsettings.json
or as environment variables.
Example for appsettings.json
:
{
"GoogleAuth": {
"ClientId": "YOUR_GOOGLE_CLIENT_ID",
"ClientSecret": "YOUR_GOOGLE_CLIENT_SECRET"
}
}