17 instantiations of AuthenticationHeaderValue
dotnet-sourcelink (2)
AuthenticationHeaderProvider.cs (1)
28
=>
new
("Basic", Convert.ToBase64String(_encoding.GetBytes($"{_username}:{_password}")));
Program.cs (1)
532
AuthenticationMethod.Basic => new
AuthenticationHeaderValue
(
Keycloak.Web (1)
AuthorizationHandler.cs (1)
17
request.Headers.Authorization = new
AuthenticationHeaderValue
("Bearer", accessToken);
Microsoft.Extensions.AI.Evaluation.Safety (1)
ContentSafetyService.cs (1)
441
httpRequestMessage.Headers.Authorization = new
AuthenticationHeaderValue
("Bearer", token.Token);
Microsoft.NET.Build.Containers (4)
AuthHandshakeMessageHandler.cs (4)
196
var authValue = new
AuthenticationHeaderValue
(BasicAuthScheme, Convert.ToBase64String(Encoding.ASCII.GetBytes($"{privateRepoCreds.Username}:{privateRepoCreds.Password}")));
498
var authValue = new
AuthenticationHeaderValue
(BearerAuthScheme, tokenResponse.ResolvedToken);
515
var header = new
AuthenticationHeaderValue
(BasicAuthScheme, Convert.ToBase64String(Encoding.ASCII.GetBytes($"{privateRepoCreds.Username}:{privateRepoCreds.Password}")));
544
return (new
AuthenticationHeaderValue
(BearerAuthScheme, token.ResolvedToken), token.ResolvedExpiration);
Microsoft.NET.Sdk.Publish.Tasks (2)
Tasks\Http\HttpClientExtensions.cs (2)
288
client.DefaultRequestHeaders.Authorization = new
AuthenticationHeaderValue
(BasicAuthenticationScheme, base64);
292
client.DefaultRequestHeaders.Authorization = new
AuthenticationHeaderValue
(BearerAuthenticationScheme, password);
Pipelines.Library (1)
DistributedApplicationPipelineExtensions.cs (1)
149
httpClient.DefaultRequestHeaders.Authorization = new
AuthenticationHeaderValue
("Bearer", accessToken.Token);
System.Net.Http (6)
System\Net\Http\Headers\AuthenticationHeaderValue.cs (3)
156
parsedValue = new
AuthenticationHeaderValue
(scheme);
189
parsedValue = new
AuthenticationHeaderValue
(scheme, parameter);
293
return new
AuthenticationHeaderValue
(this);
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.cs (2)
184
SetRequestAuthenticationHeaderValue(request, new
AuthenticationHeaderValue
(BasicScheme, base64AuthString), isProxyAuth);
201
var headerValue = new
AuthenticationHeaderValue
(DigestScheme, parameter);
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.NtAuth.cs (1)
168
SetRequestAuthenticationHeaderValue(request, new
AuthenticationHeaderValue
(challenge.SchemeName, challengeResponse), isProxyAuth);
42 references to AuthenticationHeaderValue
dotnet-sourcelink (5)
AuthenticationHeaderProvider.cs (2)
11
AuthenticationHeaderValue
GetValue();
27
public
AuthenticationHeaderValue
GetValue()
Program.cs (3)
184
var
authenticationHeader = (authMethod != null) ? GetAuthenticationHeader(authMethod, authEncoding ?? Encoding.ASCII, user!, password!) : null;
198
private async Task<int> TestAsync(string path,
AuthenticationHeaderValue
? authenticationHeader, bool offline, CancellationToken cancellationToken)
528
private static
AuthenticationHeaderValue
GetAuthenticationHeader(string method, Encoding encoding, string username, string password)
Microsoft.NET.Build.Containers (10)
AuthHandshakeMessageHandler.cs (10)
44
private static ConcurrentDictionary<string,
AuthenticationHeaderValue
?> _authenticationHeaders = new();
85
AuthenticationHeaderValue
header = authenticateHeader.First();
171
private async Task<(
AuthenticationHeaderValue
, DateTimeOffset)?> GetAuthenticationAsync(string registry, string scheme, AuthInfo? bearerAuthInfo, CancellationToken cancellationToken)
196
var
authValue = new AuthenticationHeaderValue(BasicAuthScheme, Convert.ToBase64String(Encoding.ASCII.GetBytes($"{privateRepoCreds.Username}:{privateRepoCreds.Password}")));
455
private async Task<(
AuthenticationHeaderValue
, DateTimeOffset)?> TryOAuthPostAsync(DockerCredentials privateRepoCreds, AuthInfo bearerAuthInfo, Uri realmUri, CancellationToken cancellationToken)
498
var
authValue = new AuthenticationHeaderValue(BearerAuthScheme, tokenResponse.ResolvedToken);
511
private async Task<(
AuthenticationHeaderValue
, DateTimeOffset)?> TryTokenGetAsync(DockerCredentials privateRepoCreds, AuthInfo bearerAuthInfo, Uri realmUri, CancellationToken cancellationToken)
515
var
header = new AuthenticationHeaderValue(BasicAuthScheme, Convert.ToBase64String(Encoding.ASCII.GetBytes($"{privateRepoCreds.Username}:{privateRepoCreds.Password}")));
579
if (_authenticationHeaders.TryGetValue(_registryName, out
AuthenticationHeaderValue
? header))
602
if (await GetAuthenticationAsync(_registryName, scheme!, authInfo, cancellationToken).ConfigureAwait(false) is (
AuthenticationHeaderValue
authHeader, DateTimeOffset expirationTime))
netstandard (1)
netstandard.cs (1)
1098
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.Http.Headers.
AuthenticationHeaderValue
))]
System.Net.Http (26)
System\Net\Http\Headers\AuthenticationHeaderValue.cs (7)
46
private AuthenticationHeaderValue(
AuthenticationHeaderValue
source)
65
AuthenticationHeaderValue
? other = obj as
AuthenticationHeaderValue
;
96
public static
AuthenticationHeaderValue
Parse(string input)
99
return (
AuthenticationHeaderValue
)GenericHeaderParser.SingleValueAuthenticationParser.ParseValue(
103
public static bool TryParse([NotNullWhen(true)] string? input, [NotNullWhen(true)] out
AuthenticationHeaderValue
? parsedValue)
110
parsedValue = (
AuthenticationHeaderValue
)output!;
System\Net\Http\Headers\GenericHeaderParser.cs (2)
25
internal static readonly GenericHeaderParser SingleValueAuthenticationParser = new GenericHeaderParser(false,
AuthenticationHeaderValue
.GetAuthenticationLength);
26
internal static readonly GenericHeaderParser MultipleValueAuthenticationParser = new GenericHeaderParser(true,
AuthenticationHeaderValue
.GetAuthenticationLength);
System\Net\Http\Headers\HttpRequestHeaders.cs (4)
49
public
AuthenticationHeaderValue
? Authorization
51
get { return (
AuthenticationHeaderValue
?)GetSingleParsedValue(KnownHeaders.Authorization.Descriptor); }
176
public
AuthenticationHeaderValue
? ProxyAuthorization
178
get { return (
AuthenticationHeaderValue
?)GetSingleParsedValue(KnownHeaders.ProxyAuthorization.Descriptor); }
System\Net\Http\Headers\HttpResponseHeaders.cs (4)
53
public HttpHeaderValueCollection<
AuthenticationHeaderValue
> ProxyAuthenticate =>
54
GetSpecializedCollection(ProxyAuthenticateSlot, static thisRef => new HttpHeaderValueCollection<
AuthenticationHeaderValue
>(KnownHeaders.ProxyAuthenticate.Descriptor, thisRef));
68
public HttpHeaderValueCollection<
AuthenticationHeaderValue
> WwwAuthenticate =>
69
GetSpecializedCollection(WwwAuthenticateSlot, static thisRef => new HttpHeaderValueCollection<
AuthenticationHeaderValue
>(KnownHeaders.WWWAuthenticate.Descriptor, thisRef));
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.cs (9)
44
private static bool TryGetChallengeDataForScheme(string scheme, HttpHeaderValueCollection<
AuthenticationHeaderValue
> authenticationHeaderValues, out string? challengeData)
46
foreach (
AuthenticationHeaderValue
ahv in authenticationHeaderValues)
68
HttpHeaderValueCollection<
AuthenticationHeaderValue
> authenticationHeaderValues = GetResponseAuthenticationHeaderValues(response, isProxyAuth: false);
69
foreach (
AuthenticationHeaderValue
ahv in authenticationHeaderValues)
81
HttpHeaderValueCollection<
AuthenticationHeaderValue
> authenticationHeaderValues, out AuthenticationChallenge challenge)
119
HttpHeaderValueCollection<
AuthenticationHeaderValue
> authenticationHeaderValues = GetResponseAuthenticationHeaderValues(response, isProxyAuth);
157
private static HttpHeaderValueCollection<
AuthenticationHeaderValue
> GetResponseAuthenticationHeaderValues(HttpResponseMessage response, bool isProxyAuth)
164
private static void SetRequestAuthenticationHeaderValue(HttpRequestMessage request,
AuthenticationHeaderValue
headerValue, bool isProxyAuth)
201
var
headerValue = new AuthenticationHeaderValue(DigestScheme, parameter);