dev-master
9999999-dev https://github.com/denault/slim-basic-authHTTP Basic Authentication Middleware for Slim Framework
MIT
The Requires
- php >=5.3.0
- slim/slim >=2.3.0
by Charles Denault
middleware auth slim
Wallogit.com
2017 © Pedro Peláez
HTTP Basic Authentication Middleware for Slim Framework
Forked from: https://travis-ci.org/tuupola/slim-basic-auth, (*1)
This middleware implements HTTP Basic Authentication for Slim Framework., (*2)
You can install the middleware using composer., (*3)
{
"require": {
"tuupola/slim-basic-auth": "dev-master",
}
}
Configuration options are passed as an array. Only mandatory parameter is users. This is an array where you pass one or more "username" => "password" combinations. Username is the key and password is the value., (*4)
$app = new \Slim\Slim();
$app->add(new \Slim\Middleware\HttpBasicAuth(array(
"users" => array(
"root" => "t00r",
"user" => "passw0rd"
)
)));
With optional path parameter can authenticate only given part of your website. You can also change the displayed realm using the parameter with same name., (*5)
$app = new \Slim\Slim();
$app->add(new \Slim\Middleware\HttpBasicAuth(array(
"path" => "/admin",
"realm" => "Protected",
"users" => array(
"root" => "t00r",
"user" => "passw0rd"
)
)));
HTTP Basic Authentication Middleware for Slim Framework
MIT
middleware auth slim