Interface IConnectionResolverAccessTokenProvider
- Namespace
- Cratis.Arc.Connections
- Assembly
- Cratis.Arc.Core.dll
Defines a provider of bearer tokens for HttpConnectionResolver to authenticate to its endpoint with.
public interface IConnectionResolverAccessTokenProvider
- Extension Methods
Remarks
Register implementations in the service collection; the first one that can provide for the configured HttpConnectionResolverAuthenticationOptions is used. Tokens are cached by the resolver, so a provider is only called when a token is missing, about to expire or was rejected.
Methods
CanProvide(HttpConnectionResolverAuthenticationOptions)
Check whether the provider can provide tokens for the given options.
bool CanProvide(HttpConnectionResolverAuthenticationOptions options)
Parameters
Returns
- bool
True if it can, false if not.
GetToken(HttpConnectionResolverAuthenticationOptions, CancellationToken)
Get a fresh token.
ValueTask<ConnectionResolverAccessToken> GetToken(HttpConnectionResolverAuthenticationOptions options, CancellationToken cancellationToken)
Parameters
optionsHttpConnectionResolverAuthenticationOptionscancellationTokenCancellationTokenThe CancellationToken.