public static ValueTask <ClaimCollection> AuthenticateAsync(
     this LoginAuthenticator loginAuthenticator,
     string loginName,
     string passcode,
     CancellationToken cancellationToken = default(CancellationToken))
 {
     return(loginAuthenticator.AuthenticateAsync(new LoginRequest(loginName, passcode), cancellationToken));
 }
 public static ValueTask <ClaimCollection> AuthenticateAsync(
     this LoginAuthenticator loginAuthenticator,
     LoginRequest loginRequest,
     CancellationToken cancellationToken = default(CancellationToken))
 {
     return(loginAuthenticator.AuthenticateAsync(new [] { loginRequest })
            .FirstOrDefaultAsync(cancellationToken));
 }
 public LoginAuthentication(LoginAuthenticator loginAuthenticator, ILogger <LoginAuthentication> logger)
 {
     _loginAuthenticator = loginAuthenticator ?? throw new ArgumentNullException(nameof(loginAuthenticator));
     _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
 }