Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/azranel/plug_password
Simple plug to secure your server with password
https://github.com/azranel/plug_password
authentication elixir library phoenix plug
Last synced: 6 days ago
JSON representation
Simple plug to secure your server with password
- Host: GitHub
- URL: https://github.com/azranel/plug_password
- Owner: azranel
- License: mit
- Created: 2017-09-02T18:19:14.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-08T21:51:43.000Z (almost 7 years ago)
- Last Synced: 2024-10-11T20:14:01.662Z (28 days ago)
- Topics: authentication, elixir, library, phoenix, plug
- Language: Elixir
- Homepage:
- Size: 16.6 KB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - Plug for adding simple cookie-based authentication. (Framework Components)
- fucking-awesome-elixir - plug_password - Plug for adding simple cookie-based authentication. (Framework Components)
- awesome-elixir - plug_password - Plug for adding simple cookie-based authentication. (Framework Components)
README
# PlugPassword
[![Build Status](https://travis-ci.org/azranel/plug_password.svg?branch=master)](https://travis-ci.org/azranel/plug_password)
Simple authentication plug based on [rack_password](https://github.com/netguru/rack_password).
Similary it will ask you for password only once and store it in your cookie (not like basic auth).[Hex.pm package](https://hex.pm/packages/plug_password)
[HexDocs](https://hexdocs.pm/plug_password)## Installation
The package can be installed by adding `plug_password` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:plug_password, "~> 0.3.0"}
]
end
```then plug it before your router:
```elixir
plug PlugPassword.Block, passwords: ["hello", world],
template: Authentication,
path_whitelist: ~r/users/,
ip_whitelist: ["86.123.112.78"],
custom_rule: &Authentication.custom_rule/1plug PlugPasswordTestWeb.Router
```check possible options to pass to plug in [HexDocs](https://hexdocs.pm/plug_password/PlugPassword.Block.html).