shelf_auth 0.0.3 copy "shelf_auth: ^0.0.3" to clipboard
shelf_auth: ^0.0.3 copied to clipboard

outdatedDart 1 only

A shelf handler for authentication

Authentication Middleware for Dart Shelf #

Introduction #

Provides Shelf middleware for authenticating users (or systems) and establishing sessions.

Usage #

  var handler = const Pipeline()
      .addMiddleware(exceptionResponse())
      .addMiddleware(authenticate([
          new BasicAuthenticator(new TestLookup()),
          new RandomAuthenticator()]))
      .addHandler((Request request) => new Response.ok("I'm in with "
          "${getAuthenticationContext(request).map((ac) => ac.principal.name)}\n"));

  io.serve(handler, 'localhost', 8080);

Shelf Auth provides a function authenticate that takes a list of Authenticators where the first to either succeed or throw wins.

Supports custom Authenticators in addition to some standard out of the box implementations.

The SessionHandler if provided will be invoked on successful authentication if the resulting AuthenticationContext supports sessions.

Authenticators #

Shelf Auth provides the following authenticators out of the box:

Note: work in progress. Too immature just yet to use. Check back soon

0
likes
0
pub points
21%
popularity

Publisher

unverified uploader

A shelf handler for authentication

Homepage

License

unknown (LICENSE)

Dependencies

crypto, option, shelf, shelf_exception_response

More

Packages that depend on shelf_auth