Class MsalKiotaAuthProvider
- Namespace
- OneImlx.Terminal.Authentication.Msal
- Assembly
- OneImlx.Terminal.Authentication.dll
The OneImlx terminal Kiota authentication and authorization provider for MSAL identity platform.
public sealed class MsalKiotaAuthProvider : IAuthenticationProvider, IAccessTokenProvider
- Inheritance
-
MsalKiotaAuthProvider
- Implements
-
IAuthenticationProviderIAccessTokenProvider
- Inherited Members
Constructors
MsalKiotaAuthProvider(TerminalOptions, IMsalTokenAcquisition, ILogger<MsalKiotaAuthProvider>)
Initializes a new instance.
public MsalKiotaAuthProvider(TerminalOptions terminalOptions, IMsalTokenAcquisition msalTokenAcquisition, ILogger<MsalKiotaAuthProvider> logger)
Parameters
terminalOptionsTerminalOptionsThe terminal options.
msalTokenAcquisitionIMsalTokenAcquisitionThe MSAL token acquisition.
loggerILogger<MsalKiotaAuthProvider>The logger.
Properties
AllowedHostsValidator
Gets the validator that ensures the authorization request is for an allowed host.
public AllowedHostsValidator AllowedHostsValidator { get; }
Property Value
- AllowedHostsValidator
Methods
AuthenticateRequestAsync(RequestInformation, Dictionary<string, object>?, CancellationToken)
Authenticates an HTTP request by acquiring an access token and setting it in the request's Authorization header.
public Task AuthenticateRequestAsync(RequestInformation request, Dictionary<string, object>? additionalAuthenticationContext = null, CancellationToken cancellationToken = default)
Parameters
requestRequestInformationThe HTTP request to authenticate.
additionalAuthenticationContextDictionary<string, object>Optional. Additional authentication context that may contain extra scopes or other information.
cancellationTokenCancellationTokenOptional. The cancellation token to cancel the asynchronous operation.
Returns
Remarks
This method supports additional scopes provided either as an IEnumerable<T> or a single string
with scopes separated by spaces. The scopes are expected to be provided in the
additionalAuthenticationContext dictionary with the key scopes.
Exceptions
- TerminalException
Thrown if the URI is not allowed by the AllowedHostsValidator or if token acquisition fails.
GetAuthorizationTokenAsync(Uri, Dictionary<string, object>?, CancellationToken)
Asynchronously gets an authorization token for the specified URI.
public Task<string> GetAuthorizationTokenAsync(Uri uri, Dictionary<string, object>? additionalAuthenticationContext = null, CancellationToken cancellationToken = default)
Parameters
uriUriThe URI for which the authorization token is required.
additionalAuthenticationContextDictionary<string, object>Optional. Additional authentication context that may contain extra scopes or other information.
cancellationTokenCancellationTokenOptional. The cancellation token to cancel the asynchronous operation.
Returns
Remarks
This method supports additional scopes provided either as an IEnumerable<T> or a single string
with scopes separated by spaces. The scopes are expected to be provided in the
additionalAuthenticationContext dictionary with the key scopes.
Exceptions
- TerminalException
Thrown if the URI is not allowed by the AllowedHostsValidator.