TrewAppAuthenticationHandler Class
Namespace: System.Net.SecurityProvides an abstract base class for authentication handlers that can be used with the TrewApp framework for secure network communication.
Syntax
public abstract class TrewAppAuthenticationHandler<TResult> : object
Type Parameters
TResult
: The type of the result object returned by the authentication process.
Inheritance
System.Object
System.Net.Security.TrewAppAuthenticationHandler<TResult>
Remarks
The TrewAppAuthenticationHandler
class is designed to abstract the complexities of authentication protocols used within the TrewApp ecosystem. Developers can derive from this class to implement custom authentication logic for various scenarios, such as token-based authentication, certificate-based authentication, or other proprietary mechanisms.
The generic type parameter TResult
allows the handler to return specific types of authentication results, enabling flexibility in how authentication outcomes are represented and processed by the calling application.
Constructors
- TrewAppAuthenticationHandler() Protected constructor used by derived classes.
Methods
-
AuthenticateAsync(CancellationToken)
Abstract method to perform the authentication process asynchronously.
protected abstract Task<TResult> AuthenticateAsync(CancellationToken cancellationToken);
-
HandleChallengeAsync(CancellationToken)
Abstract method to handle an authentication challenge.
protected abstract Task HandleChallengeAsync(CancellationToken cancellationToken);
-
InitializeAsync(AuthenticationScheme, AuthenticateResult, IOption<TOptions>, ILogger<THandler>, UrlEncoder, ISystemClock)
Abstract method to initialize the authentication handler.
protected abstract Task InitializeAsync<TOptions, THandler>(AuthenticationScheme scheme, AuthenticateResult previousResult, IOptions<TOptions> options, ILogger<THandler> logger, UrlEncoder encoder, ISystemClock clock) where TOptions : AuthenticationSchemeOptions, new();