PHPackages                             poirot/mod-authorization - 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. poirot/mod-authorization

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

poirot/mod-authorization
========================

0213PHP

Since May 10Pushed 6y ago1 watchersCompare

[ Source](https://github.com/phPoirot/Module-Authorization)[ Packagist](https://packagist.org/packages/poirot/mod-authorization)[ RSS](/packages/poirot-mod-authorization/feed)WikiDiscussions devel Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

Module-Authorization
====================

[](#module-authorization)

Module Configuration
--------------------

[](#module-configuration)

```
# Authorization:

\Module\Authorization\Module::CONF_KEY => array(
    ServiceAuthenticatorsContainer::CONF => array(
        'plugins_container' => array(
            // these configurations are same as container builder settings...
            /** @see BuilderContainer */
            'services' => array(
                'realm_name' => instanceof (Poirot\AuthSystem\Authenticate\Authenticator)
            ),
        ),
    ),
    ServiceGuardsContainer::CONF => array(
        'plugins_container' => array(
            // these configurations are same as container builder settings...
            /** @see BuilderContainer */
            'services' => array(
                // Guards Services
                'guard_name' => instaceof (iGuard),
            ),
        ),
    ),
),
```

An example of ServiceAuthenticator plugin
-----------------------------------------

[](#an-example-of-serviceauthenticator-plugin)

```
/**
 * Authenticator Service That Register in Module Authorize as
 * authenticators capped plugin.
 *
 */
class ServiceAuthenticatorDefault
    extends aServiceContainer
{
    protected $name = \Module\OAuth2\Module::REALM;

    /**
     * Create Service
     *
     * @return Authenticator
     */
    function newService()
    {
        ## Set Credential Repo Behalf Of Users Repository
        $repoUsers = \Module\OAuth2\Services\Repository\IOC::Users();
        $credentialAdapter = __(new RepoUserPassCredential)->setRepoUsers($repoUsers);

        ### Attain Login Continue If Has
        /** @var iHttpRequest $request */
        $request  = \IOC::GetIoC()->get('/HttpRequest');

        $authenticator = new Authenticator(
            __(new IdentifierWrapIdentityMap(
                // TODO using cookie+session identifier to recognize user and feature to remember me!!
                __(new IdentifierSession)->setIssuerException(function(exAuthentication $e) use ($request) {
                    $loginUrl = (string) \Module\HttpFoundation\Actions::url('main/oauth/login'); // ensure routes loaded
                    $continue = \Module\Foundation\Actions::path(sprintf(
                        '$baseUrl/%s'
                        , ltrim($request->getTarget(), '/'))
                    );
                    $loginUrl .= '?continue='.urlencode($continue);
                    header('Location: '.$loginUrl);
                })
                /** @see Users::findOneMatchBy */
                , new IdentityFulfillmentLazy($repoUsers, 'uid')
            ))->setRealm(aIdentifier::DEFAULT_REALM)
            , $credentialAdapter // Identity Username --------^
        );

        return $authenticator;
    }

    /**
     * @override
     * !! Access Only In Capped Collection; No Nested Containers Here
     *
     * Get Service Container
     *
     * @return ContainerAuthenticatorsCapped
     */
    function services()
    {
        return parent::services();
    }
}
```

An Example of Http Guard
------------------------

[](#an-example-of-http-guard)

```
class ServiceAuthGuard
    extends aServiceContainer
{
    /**
     * Create Service
     *
     * @return GuardRoute
     */
    function newService()
    {
        $guard = new GuardRoute;
        $auth  = \Module\Authorization\Actions::Authenticator( \Module\OAuth2\Module::REALM );
        $guard->setAuthenticator( $auth );
        $guard->setRoutesDenied([
            'main/oauth/authorize',
            'main/oauth/me/*',
        ]);

        return $guard;
    }
}
```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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.

### 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 (48 commits)")

### Embed Badge

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

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

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.2M17](/packages/kartik-v-yii2-password)

PHPackages © 2026

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