plug_hyper_auth v0.2.1 HyperAuth

Plug for HTTP AAA using the HTTP auth framework.

When a configured scheme is found in the authorization header it will use that to process the values of the header (with access to the connection but the modifications are ignored), with that values and other generic values the authenticator will authenticate the user (without access to connection).

This plug is extensible with the behaviours:

This library support the common schemes then often you only need extend it with modules of HyperAuth.Authenticator behaviour (more safe than extend the schemes) like.

The behaviour of HyperAuth is showed in the next table where:

  • TLS: If the connection is secure (HTTPS, HTTP over SSL/TLS).
  • Public: If the resource is configured as public access allowed.
  • Header: If exists the authorization header in the request.
  • Auth: If the credentials are valid.
  • Status: The HTTP status code response.
  • User: The user authenticated.
TLSPublicHeaderAuthStatusUser
NONONONO403anon
NONOYESNO403anon
NONOYESYES403anon
NOYESNONO200anon
NOYESYESNO403anon
NOYESYESYES403anon
YESNONONO401anon
YESNOYESNO401anon
YESYESNONO200anon
YESYESYESNO200anon
YESNOYESYES200user
YESYESYESYES200user

Link to this section Summary

Functions

Configure the schemes alloweds and the authenticator

Link to this section Functions

Link to this function call(conn, opts)

Configure the schemes alloweds and the authenticator.

The default schemes are:

  • Basic: HyperAuth.Scheme.Basic
  • Digest: HyperAuth.Scheme.Digest