2021-05-07 00:39:20 +02:00
|
|
|
#nullable disable
|
|
|
|
|
2020-08-22 21:56:24 +02:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2019-01-13 21:01:16 +01:00
|
|
|
using System.Threading.Tasks;
|
2020-05-13 04:10:35 +02:00
|
|
|
using Jellyfin.Data.Entities;
|
2018-12-28 00:27:57 +01:00
|
|
|
using MediaBrowser.Model.Users;
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Authentication
|
|
|
|
{
|
|
|
|
public interface IAuthenticationProvider
|
|
|
|
{
|
|
|
|
string Name { get; }
|
2020-06-15 23:43:52 +02:00
|
|
|
|
2018-12-28 00:27:57 +01:00
|
|
|
bool IsEnabled { get; }
|
2020-06-15 23:43:52 +02:00
|
|
|
|
2018-12-28 00:27:57 +01:00
|
|
|
Task<ProviderAuthenticationResult> Authenticate(string username, string password);
|
2020-08-22 21:56:24 +02:00
|
|
|
|
2019-05-21 19:28:34 +02:00
|
|
|
bool HasPassword(User user);
|
2020-08-22 21:56:24 +02:00
|
|
|
|
2018-12-28 00:27:57 +01:00
|
|
|
Task ChangePassword(User user, string newPassword);
|
|
|
|
}
|
|
|
|
|
|
|
|
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; }
|
2020-06-15 23:43:52 +02:00
|
|
|
|
2018-12-28 00:27:57 +01:00
|
|
|
public string DisplayName { get; set; }
|
|
|
|
}
|
|
|
|
}
|