azranel / plug_password

Simple plug to secure your server with password

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PlugPassword

Build Status

Simple authentication plug based on rack_password. Similary it will ask you for password only once and store it in your cookie (not like basic auth).

Hex.pm package HexDocs

Installation

The package can be installed by adding plug_password to your list of dependencies in mix.exs:

def deps do
  [
    {:plug_password, "~> 0.3.0"}
  ]
end

then plug it before your router:

plug PlugPassword.Block, passwords: ["hello", world],
  template: Authentication,
  path_whitelist: ~r/users/,
  ip_whitelist: ["86.123.112.78"],
  custom_rule: &Authentication.custom_rule/1

plug PlugPasswordTestWeb.Router

check possible options to pass to plug in HexDocs.

About

Simple plug to secure your server with password

License:MIT License


Languages

Language:Elixir 100.0%