aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/User/InvalidAuthProvider.cs
blob: a11ca128ac200577b2de3f9d9de8be13ef121edf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System.Threading.Tasks;
using MediaBrowser.Controller.Authentication;

namespace Jellyfin.Server.Implementations.User
{
    /// <summary>
    /// An invalid authentication provider.
    /// </summary>
    public class InvalidAuthProvider : IAuthenticationProvider
    {
        /// <inheritdoc />
        public string Name => "InvalidOrMissingAuthenticationProvider";

        /// <inheritdoc />
        public bool IsEnabled => true;

        /// <inheritdoc />
        public Task<ProviderAuthenticationResult> Authenticate(string username, string password)
        {
            throw new AuthenticationException("User Account cannot login with this provider. The Normal provider for this user cannot be found");
        }

        /// <inheritdoc />
        public bool HasPassword(Data.Entities.User user)
        {
            return true;
        }

        /// <inheritdoc />
        public Task ChangePassword(Data.Entities.User user, string newPassword)
        {
            return Task.CompletedTask;
        }

        /// <inheritdoc />
        public void ChangeEasyPassword(Data.Entities.User user, string newPassword, string newPasswordHash)
        {
            // Nothing here
        }

        /// <inheritdoc />
        public string GetEasyPasswordHash(Data.Entities.User user)
        {
            return string.Empty;
        }
    }
}