PHPackages                             poirot/authsystem - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. poirot/authsystem

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

poirot/authsystem
=================

Service Manager Container.

42371PHP

Since Feb 25Pushed 6y ago2 watchersCompare

[ Source](https://github.com/phPoirot/AuthSystem)[ Packagist](https://packagist.org/packages/poirot/authsystem)[ RSS](/packages/poirot-authsystem/feed)WikiDiscussions devel Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

Poirot\\AuthSystem
==================

[](#poirotauthsystem)

HTTP authentication using PSR-7 interfaces.

It uses PSR-7 interface implementation for request and response classes that will read the authentication request values and generates the necessary responses.

Separate classes implement the authentication of users from a file based database of user and password records.

It provides classes to check if the user is already logged in an authenticate him in case he isn't.

Overview usage sample
---------------------

[](#overview-usage-sample)

```
$request  = new HttpRequest(new PhpServerRequestBuilder);
$response = new HttpResponse(new PhpServerResponseBuilder);
$lazyLoad = new LazyFulfillmentIdentity(['fulfillment_by' => 'username', 'data_provider' => new UserData]);
$auth     = new Authenticator\HttpSessionAuth([
    'identity' => $lazyLoad,
    'request'  => $request,
    'response' => $response,
]);
try {
    $credential = null;
    ## check user has authenticated
    login_user:
    $auth->authenticate($credential);
    echo 'Continue ...';
    if (!$auth->isSignIn()) {
        $auth->signIn();
        header('Location: '.$request->getUri()->getPath()->toString());
        die();
    }
} catch (WrongCredentialException $e) {
    throw new \Exception('Invalid Username or Password.');
} catch (UserNotFoundException $e) {
    throw new \Exception('Invalid Username or Password.');
} catch (AuthenticationException $e)
{
    if ($e->getAuthenticator() instanceof Authenticator\HttpSessionAuth)
    {
        ### handle login with satisfy request
        if ($request->plg()->methodType()->isPost()) {
            $credential = new UserPassCredential($request->plg()->phpServer()->getPost());
            goto login_user;
        }
        ### challenge user with login form, redirection or etc.
        $response->setBody('

                Please Login ...
            ');
    }
}
## run rest of program
if ($auth->hasAuthenticated()) {
    $response->setBody("Hello User {$auth->identity()->getEmail()}");
}
### send response
$response->flush();
```

TODO
----

[](#todo)

- Aggregate Authenticator
- Aggregate Adapter
- Write Authentication Service Layer On Top Of Adapters For Application Dispatching Control

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.7% 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/1f784f9dfb58e36b6a876f3057e5664bb904af71d30bb2023583118138dffe9a?d=identicon)[Payam](/maintainers/Payam)

---

Top Contributors

[![E1101](https://avatars.githubusercontent.com/u/427575?v=4)](https://github.com/E1101 "E1101 (154 commits)")[![mhndev](https://avatars.githubusercontent.com/u/5164182?v=4)](https://github.com/mhndev "mhndev (2 commits)")

### Embed Badge

![Health badge](/badges/poirot-authsystem/health.svg)

```
[![Health](https://phpackages.com/badges/poirot-authsystem/health.svg)](https://phpackages.com/packages/poirot-authsystem)
```

###  Alternatives

[lyquidity/xbrl

Classes that implement the XBRL 2.1, XDT, Formulas, Generics and XFI specifications

472.9k](/packages/lyquidity-xbrl)

PHPackages © 2026

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