IAuthenticationProvider.cs 971 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Threading;
  5. using System.Threading.Tasks;
  6. using MediaBrowser.Controller.Entities;
  7. using MediaBrowser.Model.Users;
  8. namespace MediaBrowser.Controller.Authentication
  9. {
  10. public interface IAuthenticationProvider
  11. {
  12. string Name { get; }
  13. bool IsEnabled { get; }
  14. Task<ProviderAuthenticationResult> Authenticate(string username, string password);
  15. Task<bool> HasPassword(User user);
  16. Task ChangePassword(User user, string newPassword);
  17. }
  18. public interface IRequiresResolvedUser
  19. {
  20. Task<ProviderAuthenticationResult> Authenticate(string username, string password, User resolvedUser);
  21. }
  22. public interface IHasNewUserPolicy
  23. {
  24. UserPolicy GetNewUserPolicy();
  25. }
  26. public class ProviderAuthenticationResult
  27. {
  28. public string Username { get; set; }
  29. public string DisplayName { get; set; }
  30. }
  31. }