InvalidAuthProvider.cs 1.3 KB

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