NTLMClient constructor

NTLMClient(
  1. {String domain = '',
  2. String workstation = '',
  3. required String username,
  4. String? password,
  5. String? lmPassword,
  6. String? ntPassword,
  7. Client? inner,
  8. String headerPrefix = kHeaderPrefixNTLM}
)

Creates a new NTLM client

The username is required as is either the password...

NTLMClient client = new NTLMClient(
  username: "User208",
  password: "password",
);

...or the lmPassword and the ntPassword in base 64 form.

String lmPassword = lmHash("password");
String ntPassword = ntHash("password");

NTLMClient client = new NTLMClient(
  username: "User208",
  lmPassword: lmPassword,
  ntPassword: ntPassword,
);

You can optionally pass in an inner client to make all the HTTP requests.

Implementation

NTLMClient({
  this.domain = '',
  this.workstation = '',
  required this.username,
  this.password,
  this.lmPassword,
  this.ntPassword,
  Client? inner,
  this.headerPrefix = kHeaderPrefixNTLM,
}) {
  if (password == null && (lmPassword == null || ntPassword == null)) {
    throw ArgumentError(
      'You must provide a password or the LM and NT hash of a password.',
    );
  }

  _inner = inner ?? Client();
}