Class BowireHttpAuth
- Namespace
- Kuestenlogik.Bowire.Auth
- Assembly
- Kuestenlogik.Bowire.dll
Negotiate / NTLM / Digest for every protocol that goes over HTTP (#679).
public static class BowireHttpAuth
- Inheritance
-
BowireHttpAuth
- Inherited Members
Remarks
The workbench sends the scheme and the resolved credentials as the
MarkerKey metadata entry, the same way mTLS and SigV4 travel.
A plugin hands its request and metadata to ApplyMetadata(HttpRequestMessage, IEnumerable<KeyValuePair<string, string>>?, Func<string, bool>?);
the credentials ride on the request's options, and the client from
BowireHttpClientFactory.Create answers the challenge with a handler
kept per credential set. Connection-based schemes (NTLM, Negotiate)
authenticate the TCP connection, so a connection authenticated as one
user must never carry another user's request — hence one handler each.
.NET answers Negotiate and NTLM challenges itself. Digest it does too, but
only qop=auth; BowireDigestHandler implements RFC 7616
in full, auth-int included.
Fields
MarkerKey
The metadata key the workbench, the CLI and MCP put the credentials under.
public const string MarkerKey = "__bowireHttpAuth__"
Field Value
OptionKey
Where ApplyMetadata(HttpRequestMessage, IEnumerable<KeyValuePair<string, string>>?, Func<string, bool>?) leaves the credentials on a request.
public static readonly HttpRequestOptionsKey<BowireHttpAuthConfig> OptionKey
Field Value
Properties
Capabilities
The schemes this host can use, for the workbench to offer.
public static IReadOnlyList<(string Id, bool Available, string? Reason)> Capabilities { get; }
Property Value
IntegratedAvailable
Whether Windows-integrated authentication (ambient credentials) can work here. Only a Windows host has a signed-in user's ticket to offer.
public static bool IntegratedAvailable { get; }
Property Value
Methods
ApplyMetadata(HttpRequestMessage, IEnumerable<KeyValuePair<string, string>>?, Func<string, bool>?)
Put metadata on request: the real
headers as headers, the credentials on the request's options. Bowire's
internal markers never become headers. exclude names
keys that are plugin settings rather than headers (SOAP's
soap_action, for instance).
public static void ApplyMetadata(HttpRequestMessage request, IEnumerable<KeyValuePair<string, string>>? metadata, Func<string, bool>? exclude = null)
Parameters
requestHttpRequestMessagemetadataIEnumerable<KeyValuePair<string, string>>excludeFunc<string, bool>
ApplyTo(HttpClientHandler, BowireHttpAuthConfig)
Set up handler to answer the challenge of config.
public static void ApplyTo(HttpClientHandler handler, BowireHttpAuthConfig config)
Parameters
handlerHttpClientHandlerconfigBowireHttpAuthConfig
ApplyTo(ClientWebSocketOptions, BowireHttpAuthConfig)
Set up a WebSocket handshake to answer the challenge of config.
public static void ApplyTo(ClientWebSocketOptions options, BowireHttpAuthConfig config)
Parameters
optionsClientWebSocketOptionsconfigBowireHttpAuthConfig
Remarks
Digest on a WebSocket upgrade goes through the platform, which supports qop=auth only.
Attach(HttpRequestMessage, IEnumerable<KeyValuePair<string, string>>?)
Carry what metadata asks of the HTTP layer on
request: the challenge-response credentials, and the
environment's cookie jar (#681). The factory's client acts on both.
public static void Attach(HttpRequestMessage request, IEnumerable<KeyValuePair<string, string>>? metadata)
Parameters
requestHttpRequestMessagemetadataIEnumerable<KeyValuePair<string, string>>
Parse(string?)
Parse the marker's JSON value; null when it is not usable.
public static BowireHttpAuthConfig? Parse(string? json)
Parameters
jsonstring
Returns
TryParse(IEnumerable<KeyValuePair<string, string>>?)
The credentials in metadata, or null.
public static BowireHttpAuthConfig? TryParse(IEnumerable<KeyValuePair<string, string>>? metadata)
Parameters
metadataIEnumerable<KeyValuePair<string, string>>
Returns
Wrap(HttpMessageHandler, BowireHttpAuthConfig)
inner wrapped for config: a Digest
handler for Digest, the handler itself otherwise.
public static HttpMessageHandler Wrap(HttpMessageHandler inner, BowireHttpAuthConfig config)
Parameters
innerHttpMessageHandlerconfigBowireHttpAuthConfig