Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matsumotory/mod_mruby_basic_auth
Basic Auth by mod_mruby
https://github.com/matsumotory/mod_mruby_basic_auth
Last synced: about 2 months ago
JSON representation
Basic Auth by mod_mruby
- Host: GitHub
- URL: https://github.com/matsumotory/mod_mruby_basic_auth
- Owner: matsumotory
- Created: 2013-04-12T00:25:32.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-04-12T10:39:09.000Z (almost 12 years ago)
- Last Synced: 2024-10-18T18:28:34.669Z (3 months ago)
- Size: 129 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Basic Auth Module by mod_mruby
Basic Auth Module using mod_mruby.
- mrbgem dependency for mod_mruby
`Nothing`
## How to Use
- Intall mod_mruby previously
See https://github.com/matsumoto-r/mod_mruby
- Copy `.conf`
```bash
cp mod_mruby_basic_auth.conf ${HTTPD_ROOT}/conf.d/.
```- Change `.conf` for you
```apache
AuthType basic
AuthName "Message for clients"
AuthBasicProvider mruby
mrubyAuthnCheckPassword /path/to/mruby_basic_auth.rb
require valid-user
```- Change `/path/to/.rb` for you
```ruby
user_list = {
"bilbo" => "foo",
"frodo" => "bar",
"samwise" => "baz",
"aragorn" => "qux",
"legolas" => "quux",
"gimli" => "corge",
}
anp = Apache::AuthnProvider.new
if user_list[anp.user] == anp.password
Apache.return(Apache::AuthnProvider::AUTH_GRANTED)
else
Apache.return(Apache::AuthnProvider::AUTH_DENIED)
end
```- httpd restart
```bash
service httpd restart
```