http_auth 0.3.0

Dart native js
Flutter Android iOS web

Dart http middleware for HTTP Basic and Digest authentication

pub package

http_auth #

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

The method (Basic or Digest) can optionally be autodetected.

Usage #

HTTP Basic authentication:

    import 'package:http_auth/http_auth.dart';

    main() async {
      var client = http_auth.BasicAuthClient('user', 'passwd');
      var response = client.get('http://httpbin.org/basic-auth/user/passwd');
    }

HTTP Digest authentication:

    import 'package:http_auth/http_auth.dart';

    main() async {
      var client = http_auth.DigestAuthClient('user', 'passwd');
      var response = client.get('http://httpbin.org/digest-auth/auth/user/passwd');
    }

Automatic detection of the protocol (Basic or Digest):

    import 'package:http_auth/http_auth.dart';

    main() async {
      var client = http_auth.NegotiateAuthClient('user', 'passwd');
      var response = client.get('http://httpbin.org/digest-auth/auth/user/passwd');
    }

Synchronous usage is also possible (see the example).

13
likes
110
pub points
96%
popularity

Dart http middleware for HTTP Basic and Digest authentication

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

marcoesposito1988@gmail.com

License

BSD (LICENSE)

Dependencies

convert, crypto, http

More

Packages that depend on http_auth