2020-08-22 15:56:24 -04:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2019-01-13 15:01:16 -05:00
|
|
|
using System.Threading.Tasks;
|
2020-05-12 22:10:35 -04:00
|
|
|
using Jellyfin.Data.Entities;
|
2018-12-27 18:27:57 -05:00
|
|
|
using MediaBrowser.Model.Users;
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Authentication
|
|
|
|
{
|
|
|
|
public interface IAuthenticationProvider
|
|
|
|
{
|
|
|
|
string Name { get; }
|
2020-06-15 17:43:52 -04:00
|
|
|
|
2018-12-27 18:27:57 -05:00
|
|
|
bool IsEnabled { get; }
|
2020-06-15 17:43:52 -04:00
|
|
|
|
2018-12-27 18:27:57 -05:00
|
|
|
Task<ProviderAuthenticationResult> Authenticate(string username, string password);
|
2020-08-22 15:56:24 -04:00
|
|
|
|
2019-05-21 13:28:34 -04:00
|
|
|
bool HasPassword(User user);
|
2020-08-22 15:56:24 -04:00
|
|
|
|
2018-12-27 18:27:57 -05:00
|
|
|
Task ChangePassword(User user, string newPassword);
|
|
|
|
}
|
|
|
|
|
|
|
|
public interface IRequiresResolvedUser
|
|
|
|
{
|
2023-08-21 13:09:32 -04:00
|
|
|
Task<ProviderAuthenticationResult> Authenticate(string username, string password, User? resolvedUser);
|
2018-12-27 18:27:57 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
public interface IHasNewUserPolicy
|
|
|
|
{
|
|
|
|
UserPolicy GetNewUserPolicy();
|
|
|
|
}
|
|
|
|
|
|
|
|
public class ProviderAuthenticationResult
|
|
|
|
{
|
2023-08-21 13:09:32 -04:00
|
|
|
public required string Username { get; set; }
|
2020-06-15 17:43:52 -04:00
|
|
|
|
2023-08-21 13:09:32 -04:00
|
|
|
public string? DisplayName { get; set; }
|
2018-12-27 18:27:57 -05:00
|
|
|
}
|
|
|
|
}
|