Table of Contents

Class HttpClientBuilderExtensions

Namespace
NuvTools.Security.AspNetCore.Entra
Assembly
NuvTools.Security.AspNetCore.Entra.dll

Adds the Entra workload token to an outgoing HttpClient.

public static class HttpClientBuilderExtensions
Inheritance
HttpClientBuilderExtensions
Inherited Members

Methods

AddEntraWorkloadToken(IHttpClientBuilder, string, TokenCredential?)

Sends an Entra workload token for scope on every request of this client, for an API that admits callers with AddEntraWorkload(AuthenticationBuilder, string, Action<EntraWorkloadOptions>).

public static IHttpClientBuilder AddEntraWorkloadToken(this IHttpClientBuilder builder, string scope, TokenCredential? credential = null)

Parameters

builder IHttpClientBuilder

The client's builder.

scope string

The receiving API's scope, usually its application ID URI followed by /.default.

credential TokenCredential

The identity to ask for the token. When null, the TokenCredential registered in the container is used, so the app decides once which identity it calls with.

Returns

IHttpClientBuilder