SaslMechanismNtlmNative Class

The NTLM SASL mechanism.

Definition

Namespace: MailKit.Security
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
C#
public class SaslMechanismNtlmNative : SaslMechanismNegotiateBase
Inheritance
Object    SaslMechanism    SaslMechanismNegotiateBase    SaslMechanismNtlmNative

Remarks

A SASL mechanism based on NTLM that uses .NET Core's NegotiateAuthentication class for authenticating.

  Caution

NTLM is a legacy challenge-response authentication mechanism introduced by Microsoft in the 1990's and suffers from the following weaknesses:

  • Pass-the-Hash Attacks: Stolen NTLM hashes can be reused without knowing the password.
  • Relay Attacks: NTLM does not protect against credential forwarding.
  • Cryptography: NTLMv1 relies on DES and MD4 which are both very weak. NTLMv2 relies on HMAC-MD5 which is better but still considered very weak by modern standards.

Microsoft recommends disabling NTLM and migrating to Kerberos (GSSAPI) or modern alternatives.

  Note

This class is only available on .NET 8.0 and later.

Constructors

SaslMechanismNtlmNative Initializes a new instance of the SaslMechanismNtlmNative class.
SaslMechanismNtlmNative(NetworkCredential) Initializes a new instance of the SaslMechanismNtlmNative class.
SaslMechanismNtlmNative(String, String) Initializes a new instance of the SaslMechanismNtlmNative class.

Properties

AuthMechanism Get the name of the authentication mechanism.
(Overrides SaslMechanismNegotiateBaseAuthMechanism)
Credentials Get the user's credentials.
(Inherited from SaslMechanism)
DesiredChannelBinding Get or set the desired channel-binding to be negotiated by the SASL mechanism.
(Inherited from SaslMechanismNegotiateBase)
IsAuthenticated Get or set whether the SASL mechanism has finished authenticating.
(Inherited from SaslMechanism)
MechanismName Get the name of the SASL mechanism.
(Overrides SaslMechanismMechanismName)
NegotiatedChannelBinding Get whether or not channel-binding was negotiated by the SASL mechanism.
(Inherited from SaslMechanismNegotiateBase)
NegotiatedSecurityLayer Get whether or not a security layer was negotiated by the SASL mechanism.
(Inherited from SaslMechanismNegotiateBase)
RequiredProtectionLevel Get the required protection level.
(Inherited from SaslMechanismNegotiateBase)
ServicePrincipalName Get or set the service principal name (SPN) of the service that the client wishes to authenticate with.
(Inherited from SaslMechanismNegotiateBase)
SupportsChannelBinding Get whether or not the SASL mechanism supports channel binding.
(Inherited from SaslMechanismNegotiateBase)
SupportsInitialResponse Get whether or not the SASL mechanism supports an initial response (SASL-IR).
(Inherited from SaslMechanismNegotiateBase)
SupportsSecurityLayer Get whether or not the SASL mechanism supports negotiating a security layer.
(Inherited from SaslMechanismNegotiateBase)

Methods

Challenge(String, CancellationToken) Decode the base64-encoded server challenge and return the next challenge response encoded in base64.
(Inherited from SaslMechanism)
Challenge(Byte, Int32, Int32, CancellationToken) Parse the server's challenge token and return the next challenge response.
(Inherited from SaslMechanismNegotiateBase)
ChallengeAsync(String, CancellationToken) Asynchronously decode the base64-encoded server challenge and return the next challenge response encoded in base64.
(Inherited from SaslMechanism)
ChallengeAsync(Byte, Int32, Int32, CancellationToken) Asynchronously parse the server's challenge token and return the next challenge response.
(Inherited from SaslMechanism)
CreateClientOptions Create the NegotiateAuthenticationClientOptions.
(Inherited from SaslMechanismNegotiateBase)
Equals Determines whether the specified object is equal to the current object.
(Inherited from Object)
Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCode Serves as the default hash function.
(Inherited from Object)
GetType Gets the Type of the current instance.
(Inherited from Object)
MemberwiseClone Creates a shallow copy of the current Object.
(Inherited from Object)
Reset Reset the state of the SASL mechanism.
(Inherited from SaslMechanismNegotiateBase)
ToString Returns a string that represents the current object.
(Inherited from Object)
TryGetChannelBinding Try to get a channel-binding.
(Inherited from SaslMechanism)
TryGetChannelBindingToken Try to get a channel-binding token.
(Inherited from SaslMechanism)

See Also