Nandel.Extensions.Http.GoogleIdentityProvider
1.0.0-alpha.4
This is a prerelease version of Nandel.Extensions.Http.GoogleIdentityProvider.
dotnet add package Nandel.Extensions.Http.GoogleIdentityProvider --version 1.0.0-alpha.4
NuGet\Install-Package Nandel.Extensions.Http.GoogleIdentityProvider -Version 1.0.0-alpha.4
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="Nandel.Extensions.Http.GoogleIdentityProvider" Version="1.0.0-alpha.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nandel.Extensions.Http.GoogleIdentityProvider" Version="1.0.0-alpha.4" />
<PackageReference Include="Nandel.Extensions.Http.GoogleIdentityProvider" />
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 Nandel.Extensions.Http.GoogleIdentityProvider --version 1.0.0-alpha.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Nandel.Extensions.Http.GoogleIdentityProvider, 1.0.0-alpha.4"
#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 Nandel.Extensions.Http.GoogleIdentityProvider@1.0.0-alpha.4
#: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=Nandel.Extensions.Http.GoogleIdentityProvider&version=1.0.0-alpha.4&prerelease
#tool nuget:?package=Nandel.Extensions.Http.GoogleIdentityProvider&version=1.0.0-alpha.4&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Nandel.Extensions.Http.GoogleIdentityProvider
This library add a quick way to authenticate you service-to-service communications using Google Authentication
Google Docs: https://cloud.google.com/run/docs/authenticating/service-to-service
Install
dotnet add package Nandel.Extensions.Http.GoogleIdentityProvider
(Required) Adding options
We need to add the options shared to all our GoogleIdentityProviders, we can do that using the example bellow:
services.AddGoogleIdentityProviderOptions("NamingIsHard");
In the configuration provider you are using, you will have the chosen configuration section provided bellow with the configurations:
- ServiceAccountKeyPath: (Optional) This Configuration should point to your Service Account Key, if is not provided, we will use an approach that does not require a key but must be executed from inside GCP
- AuthorizationHeaderName: (Optional) In case you want to customize the header name in the requests sent
{
"NamingIsHard": {
"ServiceAccountKeyPath": "my-service-account-key.json",
"AuthorizationHeaderName": "X-Serverless-Authorization"
}
}
(Option 1) Using a static value for the audience consumed
Using a static value for the Audience
services.AddHttpClient("my-google-http-client")
.AddGoogleIdentityProvider("https://my-google-cloud-run-service-url.us-central1.run.app");
(Option 2) Using a dynamic value for the Audience
services.AddHttpClient("my-google-http-client")
.AddGoogleIdentityProvider(services =>
{
var config = services.GetRequiredService<IConfiguration>();
var myAudience = config.GetValue<string>("NamingIsHard:Audience");
return myAudience;
});
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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.
-
net9.0
- Google.Apis.Auth (>= 1.69.0)
- Microsoft.Extensions.Http (>= 9.0.2)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.2)
- Microsoft.Extensions.Options (>= 9.0.2)
- System.IdentityModel.Tokens.Jwt (>= 8.5.0)
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-alpha.4 | 252 | 2/27/2025 |
| 1.0.0-alpha.3 | 104 | 2/26/2025 |
| 1.0.0-alpha.2 | 113 | 2/26/2025 |
| 1.0.0-alpha.1 | 113 | 2/25/2025 |