ntlm 1.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 79

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]
74
Health:
Code health derived from static analysis. [more]
75
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
94
Overall:
Weighted score of the above. [more]
79
Learn more about scoring.

We analyzed this package on Feb 27, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Health suggestions

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

Analysis of lib/src/messages/common/utils.dart reported 28 hints, including:

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.

line 42 col 26: Unnecessary new keyword.

line 43 col 24: Unnecessary new keyword.

line 44 col 24: Unnecessary new keyword.

Fix lib/src/des/des.dart. (-8.63 points)

Analysis of lib/src/des/des.dart reported 18 hints, including:

line 12 col 7: Unnecessary new keyword.

line 12 col 57: Unnecessary new keyword.

line 30 col 13: Unnecessary new keyword.

line 39 col 13: Unnecessary new keyword.

line 43 col 13: Unnecessary new keyword.

Fix lib/src/des/des_constants.dart. (-5.36 points)

Analysis of lib/src/des/des_constants.dart reported 11 hints, including:

line 89 col 14: Unnecessary new keyword.

line 92 col 17: Unnecessary new keyword.

line 144 col 14: Unnecessary new keyword.

line 211 col 14: Unnecessary new keyword.

line 278 col 14: Unnecessary new keyword.

Fix additional 5 files with analysis or formatting issues. (-4.98 points)

Additional issues in the following files:

  • lib/src/messages/type2.dart (3 hints)
  • lib/src/messages/type3.dart (3 hints)
  • lib/src/http.dart (2 hints)
  • lib/src/hash.dart (1 hint)
  • lib/src/messages/type1.dart (1 hint)

Maintenance suggestions

Package is getting outdated. (-6.03 points)

The package was last published 55 weeks ago.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
fixnum ^0.10.0 0.10.11
http ^0.12.0 0.12.0+4
pointycastle ^1.0.0 1.0.2
utf ^0.9.0 0.9.0+5
Transitive dependencies
async 2.4.0
charcode 1.1.3
collection 1.14.12
http_parser 3.1.3
meta 1.1.8
path 1.6.4
pedantic 1.9.0
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
test any