Skip to content

elli-lib/elli_basicauth

 
 

Repository files navigation

elli_basicauth

Basic authentication middleware for elli

Hex.pm Erlang Travis CI Coverage Status

Installation

{deps, [
  {elli, "2.0.2"},
  {elli_basicauth, "0.1.0"}
]}.

Example

  • Start an Erlang shell with elli and elli_basicauth loaded.

    rebar3 as test shell
  • Start elli_basicauth_example.

    1> {ok, Pid} = elli_basicauth_example:start_link().
  • Make requests, e.g. using HTTPie.

    http :8080/protected
    HTTP/1.1 401 Unauthorized
    Connection: Keep-Alive
    Content-Length: 12
    WWW-Authenticate: Basic realm="Admin Area"
    
    Unauthorized
    http -a user:pass :8080/protected
    HTTP/1.1 403 Forbidden
    Connection: Keep-Alive
    Content-Length: 9
    
    Forbidden

About

Basic Authentication middleware for the Elli webserver

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Erlang 100.0%