PHPackages                             deisss/slim-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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. deisss/slim-auth

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

deisss/slim-auth
================

An abstract HTTP Basic Auth middleware for PHP Slim framework, offering easy custom database schema, and url escaping possibilities

1.0.0(12y ago)71144MITPHPPHP &gt;=5.3.0

Since Mar 8Pushed 12y ago1 watchersCompare

[ Source](https://github.com/Deisss/php-slim-auth)[ Packagist](https://packagist.org/packages/deisss/slim-auth)[ Docs](https://github.com/Deisss/php-slim-auth)[ RSS](/packages/deisss-slim-auth/feed)WikiDiscussions master Synced 2d ago

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

php-slim-auth
=============

[](#php-slim-auth)

Simple, and yet powerfull middleware authentification for PHP Slim framework.

Principle
---------

[](#principle)

We try threw this system to keep it as simple as possible. So we provide an authentification in two -extremely easy- parts:

- We take care of authentification process, using HTTP Basic Auth,
- You extend this abstract class, to add your login/business logic to it.

Finally, you plug your extended class to Slim, and we are done.

Installation
------------

[](#installation)

The system is using composer as main delivery system, using `composer.json`:

```
{
    "require": {
        "deisss/slim-auth": "1.*"
    }
}
```

Recompile composer threw command line `composer update`

Usage
-----

[](#usage)

A login logic can be quite different from every system (like stateless, session based, facebook based), we decide it was necessary to provide a system where you can add your logic to it. An abstract authentification class was the best way to achieve this, and keep everything simple. So, as it's abstract, you need to create your own concrete class:

```

```

Now this class is created (we consider the file name as `HTTPBasicAuth.php`, we can use it:

```
