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.
TLS | Public | Header | Auth | Status | User |
---|---|---|---|---|---|
NO | NO | NO | NO | 403 | anon |
NO | NO | YES | NO | 403 | anon |
NO | NO | YES | YES | 403 | anon |
NO | YES | NO | NO | 200 | anon |
NO | YES | YES | NO | 403 | anon |
NO | YES | YES | YES | 403 | anon |
YES | NO | NO | NO | 401 | anon |
YES | NO | YES | NO | 401 | anon |
YES | YES | NO | NO | 200 | anon |
YES | YES | YES | NO | 200 | anon |
YES | NO | YES | YES | 200 | user |
YES | YES | YES | YES | 200 | user |
Link to this section Summary
Link to this section Functions
Link to this function
call(conn, opts)
Link to this function
init(opts)
Configure the schemes alloweds and the authenticator.
The default schemes are:
- Basic: HyperAuth.Scheme.Basic
- Digest: HyperAuth.Scheme.Digest