INTLMAuthenticationProvider.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
  2. *
  3. * You can redistribute this program and/or modify it under the terms of
  4. * the GNU Lesser Public License as published by the Free Software Foundation,
  5. * either version 3 of the License, or (at your option) any later version.
  6. */
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Text;
  10. using SMBLibrary.Authentication;
  11. namespace SMBLibrary.Server
  12. {
  13. public interface INTLMAuthenticationProvider
  14. {
  15. // CIFS style NTLM
  16. byte[] GenerateServerChallenge();
  17. User Authenticate(string accountNameToAuth, byte[] lmResponse, byte[] ntlmResponse);
  18. // SSPI style NTLM
  19. byte[] GetChallengeMessageBytes(byte[] negotiateMessageBytes);
  20. User Authenticate(byte[] authenticateMessageBytes);
  21. /// <summary>
  22. /// Permit access to this user via the guest user account if the normal authentication process fails.
  23. /// </summary>
  24. /// <remarks>
  25. /// Windows will permit fallback when these conditions are met:
  26. /// 1. The guest user account is enabled.
  27. /// 2. The guest user account does not have a password set.
  28. /// 3. The specified account does not exist.
  29. /// OR:
  30. /// The password is correct but 'limitblankpassworduse' is set to 1 (logon over a network is disabled for accounts without a password).
  31. /// </remarks>
  32. bool FallbackToGuest(string userName);
  33. List<string> ListUsers();
  34. }
  35. }