InvalidAuthProvider.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. using MediaBrowser.Controller.Net;
  8. namespace Emby.Server.Implementations.Library
  9. {
  10. public class InvalidAuthProvider : IAuthenticationProvider
  11. {
  12. public string Name => "InvalidOrMissingAuthenticationProvider";
  13. public bool IsEnabled => true;
  14. public Task<ProviderAuthenticationResult> Authenticate(string username, string password)
  15. {
  16. throw new SecurityException("User Account cannot login with this provider. The Normal provider for this user cannot be found");
  17. }
  18. public Task<bool> HasPassword(User user)
  19. {
  20. return Task.FromResult(true);
  21. }
  22. public Task ChangePassword(User user, string newPassword)
  23. {
  24. return Task.CompletedTask;
  25. }
  26. public void ChangeEasyPassword(User user, string newPassword, string newPasswordHash)
  27. {
  28. // Nothing here
  29. }
  30. public string GetPasswordHash(User user)
  31. {
  32. return string.Empty;
  33. }
  34. public string GetEasyPasswordHash(User user)
  35. {
  36. return string.Empty;
  37. }
  38. }
  39. }