Client/AuthorizationHeaderExtensions.cs

foss · identity-model/src/IdentityModel/Client/AuthorizationHeaderExtensions.cs · csharp · Apache-2.0
auth

Extension methods for setting basic, bearer, and DPoP authorization headers on HttpClient and HttpRequestMessage.

// Source: https://github.com/DuendeSoftware/foss | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
// Copyright (c) Duende Software. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

using System.Net.Http.Headers;
using static Duende.IdentityModel.OidcConstants;

namespace Duende.IdentityModel.Client;

/// <summary>
/// Extensions for HttpRequestMessage
/// </summary>
public static class AuthorizationHeaderExtensions
{
    /// <summary>
    /// Sets a basic authentication header.
    /// </summary>
    /// <param name="client">The client.</param>
    /// <param name="userName">Name of the user.</param>


... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key