NTLM Authentication using Flutter / dart

2019-02-16 12:09发布

问题:

Backstory, I am trying to connect to a website that uses NTLM Authentication. I've been facing a lot of issues already concerning that but I am persistent and I want to succeed.

I am using Flutter and I tried searching for any http client in dart that supports NTLM / NTLM/2 authentication and I can't find anything. Is there a way to implement/ connect to a website using NTLM that works in flutter?

回答1:

It's probably a bit late for this question specifically, but if anyone stumbles upon this like I did when searching for a solution, I've just released https://github.com/mrbbot/ntlm.

It's not tested extensively but it seems to be working for me.


Installing

Add the dependency to your pubspec.yaml file:

dependencies:
  ntlm: ^1.0.2

Example Usage

import 'package:ntlm/ntlm.dart';

main() {
  NTLMClient client = new NTLMClient(
    domain: "",
    workstation: "LAPTOP",
    username: "User208",
    password: "password",
  );

  client.get("https://example.com/").then((res) {
    print(res.body);
  });
}


标签: dart flutter