2017 © Pedro Peláez
 

library slim-basic-auth

HTTP Basic Authentication Middleware for Slim Framework

image

denault/slim-basic-auth

HTTP Basic Authentication Middleware for Slim Framework

  • Tuesday, June 10, 2014
  • by denault
  • Repository
  • 1 Watchers
  • 0 Stars
  • 149 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 51 Forks
  • 0 Open issues
  • 1 Versions
  • 1 % Grown

The README.md

Basic Auth Middleware for Slim Build Status

Forked from: https://travis-ci.org/tuupola/slim-basic-auth, (*1)

This middleware implements HTTP Basic Authentication for Slim Framework., (*2)

Install

You can install the middleware using composer., (*3)

{
    "require": {
        "tuupola/slim-basic-auth": "dev-master",
    }
}

Usage

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"
    )
)));

The Versions

10/06 2014

dev-master

9999999-dev https://github.com/denault/slim-basic-auth

HTTP Basic Authentication Middleware for Slim Framework

  Sources   Download

MIT

The Requires

 

by Charles Denault

middleware auth slim