InvalidAuthProvider.cs 1.2 KB

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