Soenneker.Kiota.BearerAuthenticationProvider 4.0.50

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

A host-restricted Kiota authentication provider for static bearer tokens.

Install

dotnet add package Soenneker.Kiota.BearerAuthenticationProvider

Usage

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

var authentication = new BearerAuthenticationProvider(
    accessToken,
    "api.example.com");

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

Supply host names without a scheme or path. The multiple-host constructor accepts an IEnumerable<string>.

The provider replaces Authorization with Bearer <token> only when the final request URI uses HTTPS and its host is allowed. It removes an existing authorization header when the URI is not allowed, preventing a reused RequestInformation or Kiota raw-URL request from carrying the token to another host.

Plain HTTP is rejected by default. allowInsecureHttp: true exists for controlled local development only. This provider stores one static token; create a new provider when it changes, or use a Kiota access-token provider for refreshable OAuth credentials.

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 (2)

Showing the top 2 NuGet packages that depend on Soenneker.Kiota.BearerAuthenticationProvider:

Package Downloads
Soenneker.Cloudflare.Utils.Client

Thread-safe caching and configuration for generated Cloudflare OpenAPI clients.

Soenneker.X.ClientUtil

Provides a cached X OpenAPI client authenticated with a configured bearer token.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.50 1,139 9/8/2026
4.0.49 3,009 9/4/2026
4.0.48 1,543 9/3/2026
4.0.47 272 8/30/2026
4.0.46 6,740 8/29/2026
4.0.45 1,072 8/29/2026
4.0.44 87,215 7/28/2026
4.0.43 36,032 7/16/2026
4.0.42 47,120 6/18/2026
4.0.41 43,637 6/5/2026
4.0.40 128 6/5/2026
4.0.39 41,634 5/7/2026
4.0.38 1,179 5/6/2026
4.0.37 29,643 4/22/2026
4.0.36 49,373 3/19/2026
4.0.35 14,211 3/12/2026
4.0.34 694 3/12/2026
4.0.32 1,599 3/12/2026
4.0.31 14,982 3/10/2026
4.0.30 4,830 3/9/2026
Loading failed

Update dependency Microsoft.Kiota.Abstractions to 2.1.2 (#605)