InvalidAuthProvider.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Threading.Tasks;
  5. using MediaBrowser.Controller.Authentication;
  6. using MediaBrowser.Controller.Entities;
  7. namespace Emby.Server.Implementations.Library
  8. {
  9. public class InvalidAuthProvider : IAuthenticationProvider
  10. {
  11. public string Name => "InvalidOrMissingAuthenticationProvider";
  12. public bool IsEnabled => true;
  13. public Task<ProviderAuthenticationResult> Authenticate(string username, string password)
  14. {
  15. throw new Exception("User Account cannot login with this provider. The Normal provider for this user cannot be found");
  16. }
  17. public Task<bool> HasPassword(User user)
  18. {
  19. return Task.FromResult(true);
  20. }
  21. public Task ChangePassword(User user, string newPassword)
  22. {
  23. return Task.CompletedTask;
  24. }
  25. public void ChangeEasyPassword(User user, string newPassword, string newPasswordHash)
  26. {
  27. // Nothing here
  28. }
  29. public string GetPasswordHash(User user)
  30. {
  31. return string.Empty;
  32. }
  33. public string GetEasyPasswordHash(User user)
  34. {
  35. return string.Empty;
  36. }
  37. }
  38. }