ntlm 1.0.2

NTLM #

A library for NTLM authentication in Dart/Flutter.

Installing #

Add the dependency to your pubspec.yaml file:

dependencies:
  ntlm: ^1.0.2

Example #

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);
  });
}

You can also pre-hash the password and use those results instead:

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

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

Acknowledgements #

Created from templates made available by Stagehand under a BSD-style license.

The DES code is a port of Bouncy Castle's DES Engine.

Most of the NTLM response creation code is a port of SamDecrock/node-http-ntlm which itself is a port of mullender/python-ntlm.

Password hashing functions for the type 3 message are ports of the Java code on this page.

1.0.0 #

  • Initial version

example/ntlm_example.dart

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);
  });
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  ntlm: ^1.0.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:ntlm/ntlm.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
64
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
82
Learn more about scoring.

We analyzed this package on Aug 18, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: Flutter, other

Primary library: package:ntlm/ntlm.dart with components: io.

Health suggestions

Fix lib/src/messages/common/utils.dart. (-1 points)

Analysis of lib/src/messages/common/utils.dart reported 2 hints:

line 12 col 36: DO use curly braces for all flow control structures.

line 16 col 36: DO use curly braces for all flow control structures.

Fix lib/src/http.dart. (-0.50 points)

Analysis of lib/src/http.dart reported 1 hint:

line 93 col 7: DO use curly braces for all flow control structures.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
fixnum ^0.10.0 0.10.9
http ^0.12.0 0.12.0+2
pointycastle ^1.0.0 1.0.1
utf ^0.9.0 0.9.0+5
Transitive dependencies
async 2.3.0
charcode 1.1.2
collection 1.14.12
http_parser 3.1.3
meta 1.1.7
path 1.6.4
pedantic 1.8.0+1
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
test any