InvalidAuthProvider.cs 1.2 KB

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