2019-01-13 20:01:16 +00:00
|
|
|
using System.Threading.Tasks;
|
2018-12-27 23:27:57 +00:00
|
|
|
using MediaBrowser.Controller.Entities;
|
|
|
|
using MediaBrowser.Model.Users;
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Authentication
|
|
|
|
{
|
|
|
|
public interface IAuthenticationProvider
|
|
|
|
{
|
|
|
|
string Name { get; }
|
|
|
|
bool IsEnabled { get; }
|
|
|
|
Task<ProviderAuthenticationResult> Authenticate(string username, string password);
|
2019-05-21 17:28:34 +00:00
|
|
|
bool HasPassword(User user);
|
2018-12-27 23:27:57 +00:00
|
|
|
Task ChangePassword(User user, string newPassword);
|
2019-05-25 17:46:55 +00:00
|
|
|
void ChangeEasyPassword(User user, string newPassword, string newPasswordHash);
|
|
|
|
string GetEasyPasswordHash(User user);
|
2018-12-27 23:27:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public interface IRequiresResolvedUser
|
|
|
|
{
|
|
|
|
Task<ProviderAuthenticationResult> Authenticate(string username, string password, User resolvedUser);
|
|
|
|
}
|
|
|
|
|
|
|
|
public interface IHasNewUserPolicy
|
|
|
|
{
|
|
|
|
UserPolicy GetNewUserPolicy();
|
|
|
|
}
|
|
|
|
|
|
|
|
public class ProviderAuthenticationResult
|
|
|
|
{
|
|
|
|
public string Username { get; set; }
|
|
|
|
public string DisplayName { get; set; }
|
|
|
|
}
|
|
|
|
}
|