Soenneker.Kiota.GenericAuthenticationProvider 4.0.41

Prefix Reserved
dotnet add package Soenneker.Kiota.GenericAuthenticationProvider --version 4.0.41
                    
NuGet\Install-Package Soenneker.Kiota.GenericAuthenticationProvider -Version 4.0.41
                    
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="Soenneker.Kiota.GenericAuthenticationProvider" Version="4.0.41" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Kiota.GenericAuthenticationProvider" Version="4.0.41" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Kiota.GenericAuthenticationProvider" />
                    
Project file
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 Soenneker.Kiota.GenericAuthenticationProvider --version 4.0.41
                    
#r "nuget: Soenneker.Kiota.GenericAuthenticationProvider, 4.0.41"
                    
#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 Soenneker.Kiota.GenericAuthenticationProvider@4.0.41
                    
#: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=Soenneker.Kiota.GenericAuthenticationProvider&version=4.0.41
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Kiota.GenericAuthenticationProvider&version=4.0.41
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Kiota.GenericAuthenticationProvider

A Kiota authentication provider for custom credential headers, optional companion headers, and host restrictions.

Install

dotnet add package Soenneker.Kiota.GenericAuthenticationProvider

Usage

using Microsoft.Kiota.Http.HttpClientLibrary;
using Soenneker.Kiota.GenericAuthenticationProvider;

var authentication = new GenericAuthenticationProvider(
    headerName: "X-Api-Key",
    headerValue: apiKey,
    additionalHeaders: new Dictionary<string, string>
    {
        ["Api-Version"] = "2026-01-01"
    },
    allowedHosts: new[] { "api.example.com" });

var adapter = new HttpClientRequestAdapter(
    authentication,
    httpClient: httpClient);

Host names do not include a scheme or path. On an allowed HTTPS request, the provider replaces the configured credential header and companion headers with the configured values. On an off-host request, it removes those headers so a reused RequestInformation or Kiota raw-URL call cannot carry credentials elsewhere.

Always supply allowedHosts when the API host is known. For compatibility, omitting it pins the provider to the first HTTPS host it authenticates; later hosts receive no credential headers. An explicit allowlist is safer because it also protects the first request.

Plain HTTP is rejected by default. Set allowInsecureHttp: true only for a controlled local endpoint. The provider snapshots additionalHeaders during construction, so later dictionary changes do not alter live authentication behavior.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.

NuGet packages (19)

Showing the top 5 NuGet packages that depend on Soenneker.Kiota.GenericAuthenticationProvider:

Package Downloads
Soenneker.TrustedForm.Certificates.ClientUtil

Provides lazily initialized, authenticated access to the TrustedForm Certificate API v4 client.

Soenneker.Calendly.OpenApiClientUtil

A thread-safe utility for obtaining Calendly's OpenApiClient singleton.

Soenneker.Bandwidth.OpenApiClientUtil

A thread-safe utility for obtaining Bandwidth's OpenApiClient singleton.

Soenneker.Asana.OpenApiClientUtil

A thread-safe utility for obtaining Asana's OpenApiClient singleton.

Soenneker.Twilio.OpenApiClientUtil

Provides an authenticated, cached Twilio OpenAPI client

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.41 1,755 8/30/2026
4.0.40 2,916 8/29/2026
4.0.39 76 8/29/2026
4.0.38 43,496 7/28/2026
4.0.37 6,372 7/21/2026
4.0.36 14,587 7/16/2026
4.0.35 27,086 6/18/2026
4.0.34 21,097 6/5/2026
4.0.33 138 6/5/2026
4.0.32 17,529 5/7/2026
4.0.31 1,877 5/6/2026
4.0.30 14,015 4/22/2026
4.0.29 12,722 3/20/2026
4.0.28 620 3/12/2026
4.0.27 122 3/12/2026
4.0.25 221 3/12/2026
4.0.24 550 3/10/2026
4.0.23 327 3/9/2026
4.0.22 131 3/9/2026
4.0.21 118 3/9/2026
Loading failed

Harden generic authentication headers