27 lines
890 B
C#
27 lines
890 B
C#
using System.Net;
|
|
using System.Security.Claims;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace AMWD.Common.AspNetCore.BasicAuthentication
|
|
{
|
|
/// <summary>
|
|
/// Interface representing the validation of a basic authentication.
|
|
/// </summary>
|
|
public interface IBasicAuthenticationValidator
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the realm to use when requesting authentication.
|
|
/// </summary>
|
|
string Realm { get; set; }
|
|
|
|
/// <summary>
|
|
/// Validates a username and password for Basic Authentication.
|
|
/// </summary>
|
|
/// <param name="username">A username.</param>
|
|
/// <param name="password">A password.</param>
|
|
/// <param name="remoteAddress">The remote client's IP address.</param>
|
|
/// <returns>The validated user principal or <c>null</c>.</returns>
|
|
Task<ClaimsPrincipal> ValidateAsync(string username, string password, IPAddress remoteAddress);
|
|
}
|
|
}
|