Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NTLM Authentication using Flutter / dart

Tags:

flutter

dart

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?

like image 646
Karim ElGhandour Avatar asked Jun 02 '18 14:06

Karim ElGhandour


1 Answers

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: ^2.0.1

Example Usage

import 'package:ntlm/ntlm.dart';

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

  client.get(Uri.parse("https://example.com/")).then((res) {
    print(res.body);
  });
}
like image 176
mrbbot Avatar answered Oct 08 '22 09:10

mrbbot