InvalidAuthProvider.cs 1.4 KB

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