public async Task AuthenticateWithNoAuthorizationHeaderShouldFail() { _context.Request.Headers.Add("", new Microsoft.Extensions.Primitives.StringValues("")); var result = await _authenticationHandler.AuthenticateAsync(); Assert.AreEqual(AuthenticateResult.Fail("").Succeeded, result.Succeeded); }
public async Task <ActionResult <AuthenticationResultDto> > AuthenticateAsync( [FromBody] AuthenticateUserCommand command, CancellationToken cancellationToken) { var result = await _authenticationHandler.AuthenticateAsync( command.Email, command.Password, cancellationToken); return(Ok(result)); }
public void AuthenticateAsync_NullRequest_ShouldThrowArgumentNullException() { Assert.ThrowsAsync <ArgumentNullException>(() => authHandler.AuthenticateAsync(null)); }