EveBearerAuthentication
NexusLabs.Eve¶
EveBearerAuthentication Class¶
Supplies a bearer token for eve requests.
Inheritance System.Object → EveBearerAuthentication
Implements IEveAuthentication
Constructors¶
EveBearerAuthentication(string) Constructor¶
Initializes bearer authentication with a static token.
Parameters¶
token System.String
The bearer token.
EveBearerAuthentication(Func\<CancellationToken,ValueTask\<string>>) Constructor¶
Initializes bearer authentication with a per-request token provider.
public EveBearerAuthentication(System.Func<System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<string>> tokenProvider);
Parameters¶
tokenProvider System.Func<System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<System.String>>
The provider invoked before each request.
Properties¶
EveBearerAuthentication.AuthenticationHeaderNames Property¶
Gets header names owned by this provider even when no value is emitted for a request. Implementations should declare every credential header so generic per-request headers cannot replace credentials when token resolution returns an empty result.
Implements AuthenticationHeaderNames
Property Value¶
System.Collections.Generic.IReadOnlyCollection<System.String>
Methods¶
EveBearerAuthentication.GetHeadersAsync(CancellationToken) Method¶
Resolves headers immediately before an HTTP request is sent.
public System.Threading.Tasks.ValueTask<System.Collections.Generic.IReadOnlyDictionary<string,string>> GetHeadersAsync(System.Threading.CancellationToken cancellationToken);
Parameters¶
cancellationToken System.Threading.CancellationToken
Cancels credential resolution.
Implements GetHeadersAsync(CancellationToken)
Returns¶
System.Threading.Tasks.ValueTask<System.Collections.Generic.IReadOnlyDictionary<System.String,System.String>>
Authentication headers whose values override client-level and generic per-request headers.
A protected value can be replaced only through an explicitly allowed protected-header
override.