PHPackages                             denault/slim-basic-auth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. denault/slim-basic-auth

ActiveLibrary

denault/slim-basic-auth
=======================

HTTP Basic Authentication Middleware for Slim Framework

0248PHP

Since Jun 10Pushed 11y ago1 watchersCompare

[ Source](https://github.com/denault/slim-basic-auth)[ Packagist](https://packagist.org/packages/denault/slim-basic-auth)[ RSS](/packages/denault-slim-basic-auth/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Basic Auth Middleware for Slim [![Build Status](https://camo.githubusercontent.com/fe0f6e31a5fc50b87a9785e7f56db4c863de2c4b20381c573702119ed73cbb48/68747470733a2f2f6170692e7472617669732d63692e6f72672f747575706f6c612f736c696d2d62617369632d617574682e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/tuupola/slim-basic-auth)
===========================================================================================================================================================================================================================================================================================================================================

[](#basic-auth-middleware-for-slim-)

Forked from:

This middleware implements HTTP Basic Authentication for Slim Framework.

Install
-------

[](#install)

You can install the middleware using composer.

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

Usage
-----

[](#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.

```
$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.

```
$app = new \Slim\Slim();

$app->add(new \Slim\Middleware\HttpBasicAuth(array(
    "path" => "/admin",
    "realm" => "Protected",
    "users" => array(
        "root" => "t00r",
        "user" => "passw0rd"
    )
)));
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0185ec142897d0b9d572f47c0c553f9bf6465ffe6fc7619b3b9ad7cbc7facdf6?d=identicon)[denault](/maintainers/denault)

---

Top Contributors

[![tuupola](https://avatars.githubusercontent.com/u/21913?v=4)](https://github.com/tuupola "tuupola (14 commits)")[![denault](https://avatars.githubusercontent.com/u/2985157?v=4)](https://github.com/denault "denault (8 commits)")

### Embed Badge

![Health badge](/badges/denault-slim-basic-auth/health.svg)

```
[![Health](https://phpackages.com/badges/denault-slim-basic-auth/health.svg)](https://phpackages.com/packages/denault-slim-basic-auth)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
