PHPackages                             julionc/slim-basic-auth-middleware - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. julionc/slim-basic-auth-middleware

AbandonedArchivedLibrary[HTTP &amp; Networking](/categories/http)

julionc/slim-basic-auth-middleware
==================================

HTTP Basic Authentication Middleware for Slim Framework

3.0.0(10y ago)109611MITPHPPHP &gt;=5.4.0

Since Mar 6Pushed 10y agoCompare

[ Source](https://github.com/julionc/slim-basic-auth-middleware)[ Packagist](https://packagist.org/packages/julionc/slim-basic-auth-middleware)[ RSS](/packages/julionc-slim-basic-auth-middleware/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

Slim Framework HTTP Basic Auth
==============================

[](#slim-framework-http-basic-auth)

HTTP Basic Authentication Middleware for Slim Framework.

[![Build Status](https://camo.githubusercontent.com/f81719046f82bdebf420305f220da0a814eeab5506f8b5a01d96c09f796edd18/68747470733a2f2f7472617669732d63692e6f72672f6a756c696f6e632f736c696d2d62617369632d617574682d6d6964646c65776172652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/julionc/slim-basic-auth-middleware)

This repository contains a Slim Framework HTTP Basic Auth service provider. This enables you to define Rules that will provide you with basic user authentication based on username and password set. Also, Realm and Router name set.

Install
-------

[](#install)

Via Composer

```
$ composer require julionc/slim-basic-auth-middleware
```

Requires Slim 3.0.0 or newer.

Usage
-----

[](#usage)

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

// Fetch DI Container
$container = $app->getContainer();

$basic_auth = new \Slim\HttpBasicAuth\Rule('admin', 'admin', null, '/admin');

// Register provider
$container->register($basic_auth);

$app->get('/admin', function ($req, $res, $args) {
    // Show dashboard
});

$app->get('/foo', function ($req, $res, $args) {
    // Show custom page
})->add($basic_auth);

$app->run();
```

Testing
-------

[](#testing)

```
$ phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~783 days

Total

2

Last Release

3669d ago

Major Versions

2.0.0 → 3.0.02016-04-28

PHP version history (2 changes)2.0.0PHP &gt;=5.3.0

3.0.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/1d2bc72ce9dbb860a214a933c54e43b1833db7d1d19ff0e1b3955c56f7b7c4e5?d=identicon)[julionc](/maintainers/julionc)

---

Top Contributors

[![julionc](https://avatars.githubusercontent.com/u/981762?v=4)](https://github.com/julionc "julionc (10 commits)")

---

Tags

authentication-middlewarephpslim-frameworkhttpmiddlewareauthslim

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[mezzio/mezzio

PSR-15 Middleware Microframework

3883.6M97](/packages/mezzio-mezzio)[chadicus/slim-oauth2

OAuth2 routes, middleware and utilities for use within a Slim Framework API

129365.9k3](/packages/chadicus-slim-oauth2)[eljam/guzzle-jwt-middleware

A jwt authentication middleware for guzzle 6

28722.5k3](/packages/eljam-guzzle-jwt-middleware)[hannesvdvreken/guzzle-debugbar

A Guzzle middleware that logs requests to debugbar's timeline

76410.4k1](/packages/hannesvdvreken-guzzle-debugbar)[mezzio/mezzio-helpers

Helper/Utility classes for Mezzio

134.3M67](/packages/mezzio-mezzio-helpers)[mezzio/mezzio-fastroute

FastRoute integration for Mezzio

162.7M52](/packages/mezzio-mezzio-fastroute)

PHPackages © 2026

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