InvalidAuthProvider.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using System.Threading.Tasks;
  2. using Jellyfin.Database.Implementations.Entities;
  3. using MediaBrowser.Controller.Authentication;
  4. namespace Jellyfin.Server.Implementations.Users
  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 => false;
  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. }
  31. }