Table of Contents

Class HttpTokenAuthenticator

Namespace
DCR.Workflow.Effect.Http
Assembly
DCR.Workflow.dll
public class HttpTokenAuthenticator : IHttpAuthenticator
Inheritance
HttpTokenAuthenticator
Implements
Inherited Members
Extension Methods

Constructors

HttpTokenAuthenticator(HttpTokenAuthenticatorOptions, IServiceProvider)

public HttpTokenAuthenticator(HttpTokenAuthenticatorOptions options, IServiceProvider sp)

Parameters

options HttpTokenAuthenticatorOptions
sp IServiceProvider

Methods

AddAuthentication(HttpRequestMessage, Dictionary<string, string>)

Authentication mechanism implementation.

public Task<HttpClient?> AddAuthentication(HttpRequestMessage request, Dictionary<string, string> secrets)

Parameters

request HttpRequestMessage

The HTTP request about to be transmitted

secrets Dictionary<string, string>

Host-system provided secrets that the mechanism may use. ('Secrets' is 'secret from the DCR model'; it may include information about, e.g., the id of the current user for the purposes of looking up credentials.)

Returns

Task<HttpClient>

Remarks

The mechanism has two options for adding authentication to the HTTP request in question:

  1. It can directly manipulate the provided , and/or
  2. It can return a custom HttpClient which will subsequently be used to transmit the request.

Manipulating the request is typically easier, but some authentication mechanisms, notably client certificates, can only be realised by a custom HttpClient.

The authentication mechanism is permitted to do both.