Crv5heR.OAuth.Google
1.0.1
dotnet add package Crv5heR.OAuth.Google --version 1.0.1
NuGet\Install-Package Crv5heR.OAuth.Google -Version 1.0.1
<PackageReference Include="Crv5heR.OAuth.Google" Version="1.0.1" />
paket add Crv5heR.OAuth.Google --version 1.0.1
#r "nuget: Crv5heR.OAuth.Google, 1.0.1"
// Install Crv5heR.OAuth.Google as a Cake Addin
#addin nuget:?package=Crv5heR.OAuth.Google&version=1.0.1
// Install Crv5heR.OAuth.Google as a Cake Tool
#tool nuget:?package=Crv5heR.OAuth.Google&version=1.0.1
YAGOA
Yet another Google OAuth Library
YAGOA is a .NET Library that consumes the Google OAuth API to retrieve the authorized user data for the backend to process
You can use it to validate the user email and info when creating a new account or logging in.
of course you'll need to authenticate on the Frontend side to retrieve to Google Bearer Token
I suggest using react-oauth by MomenSherif on the frontend side.
Usage
You can simply use this library by creating an instance of GoogleService
and call AuthenticateAsync()
:
GoogleService googleService = new GoogleService();
GoogleAuthRequest googleAuthRequest = new GoogleAuthRequest
{
Token = "YOUR_GOOGLE_ACCESS_TOKEN"
};
GoogleAuthResponse googleAuthResponse =
await googleService.AuthenticateAsync(googleAuthRequest);
GoogleAuthResponse
will return the following data:
- Name
- GivenName (First Name)
- FamilyName (Last Name)
- Picture (Picture URL)
- HostedDomain (User's Organization Domain)
- Locale
Expectations
- The
Token
property inGoogleAuthRequest
is the Bearer Token that you get from the frontend - The
GoogleAuthResponse
will contain the user's data if the token is valid
Packages that I used
Why I Made This
The main reason Is to simplify my work process by reusing the same code every time for SSO Authentication
Contributing
I welcome any sort of contribution, Please use The-Standard.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- RESTFulSense (>= 2.17.0)
- Xeption (>= 2.6.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.