http_auth 0.2.0

  • Example
  • Installing
  • Versions
  • 24


An http middleware for HTTP authentication (Basic/Digest).


HTTP Basic authentication:

    import 'package:http_auth/http_auth.dart';

    main() async {
      var client = http_auth.BasicAuthClient('user', 'passwd');
      var response = client.get('');

HTTP Digest authentication:

    import 'package:http_auth/http_auth.dart';

    main() async {
      var client = http_auth.DigestAuthClient('user', 'passwd');
      var response = client.get('');

Synchronous usage is also possible (see the example).


  • Upgraded for Dart 2.0 stable


  • Upgraded dependencies


  • Fixed handling of requests with a body.


  • Fixed nonce counter.


  • Initial version.


// Copyright (c) 2018, Marco Esposito (
// Please see the AUTHORS file for details. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file.

import 'package:http_auth/http_auth.dart';

main() {
  var client = new DigestAuthClient("user", "passwd");

  final url = '';

  client.get(url).then((r) => print(r.body));

Use this package as a library

1. Depend on it

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

  http_auth: ^0.2.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

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

3. Import it

Now in your Dart code, you can use:

import 'package:http_auth/http_auth.dart';
Version Uploaded Documentation Archive
0.2.0 Sep 11, 2018 Go to the documentation of http_auth 0.2.0 Download http_auth 0.2.0 archive
0.1.3 Jun 14, 2018 Go to the documentation of http_auth 0.1.3 Download http_auth 0.1.3 archive
0.1.2 Jun 11, 2018 Go to the documentation of http_auth 0.1.2 Download http_auth 0.1.2 archive
0.1.1 May 16, 2018 Go to the documentation of http_auth 0.1.1 Download http_auth 0.1.1 archive
0.1.0 May 3, 2018 Go to the documentation of http_auth 0.1.0 Download http_auth 0.1.0 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Fix dependencies in pubspec.yaml.

Running pub upgrade failed with the following output:

ERR: The current Dart SDK version is 2.0.0.
 Because http_auth depends on cryptoutils >=0.1.1 which requires SDK version <2.0.0, version solving failed.

Health suggestions

Format lib/http_auth.dart.

Run dartfmt to format lib/http_auth.dart.

Format lib/src/http_auth_basic.dart.

Run dartfmt to format lib/src/http_auth_basic.dart.

Format lib/src/http_auth_digest.dart.

Run dartfmt to format lib/src/http_auth_digest.dart.

Format lib/src/http_auth_utils.dart.

Run dartfmt to format lib/src/http_auth_utils.dart.

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Running dartdoc failed. (-10 points)

Make sure dartdoc runs without any issues.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0