Class MsalAccessTokenProviderDelegatingHandler
- Namespace
- OneImlx.Terminal.Authentication.Msal
- Assembly
- OneImlx.Terminal.Authentication.dll
Delegating handler that adds an access token to the request headers using an Microsoft.Kiota.Abstractions.Authentication.IAccessTokenProvider.
public class MsalAccessTokenProviderDelegatingHandler : DelegatingHandler, IDisposable
- Inheritance
-
MsalAccessTokenProviderDelegatingHandler
- Implements
- Inherited Members
Constructors
MsalAccessTokenProviderDelegatingHandler(IAccessTokenProvider, ILogger<MsalAccessTokenProviderDelegatingHandler>)
Initializes a new instance of the MsalAccessTokenProviderDelegatingHandler class.
public MsalAccessTokenProviderDelegatingHandler(IAccessTokenProvider accessTokenProvider, ILogger<MsalAccessTokenProviderDelegatingHandler> logger)
Parameters
accessTokenProviderIAccessTokenProviderThe access token provider.
loggerILogger<MsalAccessTokenProviderDelegatingHandler>The logger.
Methods
PreflightAsync(HttpRequestMessage, CancellationToken)
Performs preflight processing on the HTTP request message.
protected virtual Task PreflightAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Parameters
requestHttpRequestMessageThe HTTP request message to be processed.
cancellationTokenCancellationTokenA cancellation token to cancel the operation.
Returns
Remarks
This method can be overridden in a derived class to perform custom pre-processing on the request before it is sent. The default implementation does nothing.
SendAsync(HttpRequestMessage, CancellationToken)
Sends an HTTP request to the inner handler to send to the server as an asynchronous operation.
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Parameters
requestHttpRequestMessageThe HTTP request message to send to the server.
cancellationTokenCancellationTokenA cancellation token to cancel operation.
Returns
- Task<HttpResponseMessage>
A Task<TResult> that represents the asynchronous operation.