Cms.GoogleOAuth
1.0.0
dotnet add package Cms.GoogleOAuth --version 1.0.0
NuGet\Install-Package Cms.GoogleOAuth -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Cms.GoogleOAuth" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cms.GoogleOAuth" Version="1.0.0" />
<PackageReference Include="Cms.GoogleOAuth" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Cms.GoogleOAuth --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Cms.GoogleOAuth, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Cms.GoogleOAuth@1.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Cms.GoogleOAuth&version=1.0.0
#tool nuget:?package=Cms.GoogleOAuth&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Cms.GoogleOAuth
Overview
Cms.GoogleOAuth
is a C# library that simplifies the process of authenticating and managing OAuth 2.0 tokens for Google APIs. It provides a set of methods to handle various aspects of Google OAuth 2.0 authentication flow.
Features
🔐 User authentication with Google OAuth 2.0
🔄 Token management (refresh, revoke)
🕵️ ID token and access token validation
👤 User information retrieval
📦 Supports multiple application types (Web, API, Console)
Installation
To install Cms.GoogleOAuth
, run the following command in .NET CLI:
dotnet add package Cms.GoogleOAuth
Usage
Here's a basic example of how to use Cms.GoogleOAuth:
API Reference
AuthenticateAsync
: Authenticates the user and returns a UserCredential object.AuthenticateWithIncrementalScopesAsync
: Authenticates the user with additional scopes.ExchangeCodeForTokenAsync
: Exchanges an authorization code for a user credential.GetAuthorizationUrl
: Gets the authorization URL for the OAuth 2.0 flow.RefreshTokenAsync
: Refreshes the access token of a given UserCredential.RevokeTokenAsync
: Revokes the access token of a given UserCredential.ValidateIdTokenAsync
: Validates an ID token and returns its payload.ValidateAccessTokenAsync
: Validates an access token.GetUserInfoAsync
: Gets user information using the provided credential.
Considerations
- Security: Make sure you store your credentials and tokens securely.
- Scopes: Define appropriate scopes based on the information you need to access.
- Error Handling: Implement appropriate error handling during authentication and token operations.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License.
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. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Google.Apis.Auth (>= 1.68.0)
- Google.Apis.Oauth2.v2 (>= 1.68.0.1869)
-
net9.0
- Google.Apis.Auth (>= 1.68.0)
- Google.Apis.Oauth2.v2 (>= 1.68.0.1869)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.0.0 | 126 | 1/1/2025 |