PHPackages                             mlukman/securilex - 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. [Security](/categories/security)
4. /
5. mlukman/securilex

ActiveLibrary[Security](/categories/security)

mlukman/securilex
=================

Securilex is a simplified security provider for Silex.

1.3.0(6y ago)0662LGPL-2.0-onlyPHPPHP &gt;=5.6.0CI failing

Since May 31Pushed 6y ago1 watchersCompare

[ Source](https://github.com/MLukman/Securilex)[ Packagist](https://packagist.org/packages/mlukman/securilex)[ Docs](https://github.com/MLukman/Securilex)[ RSS](/packages/mlukman-securilex/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (4)Versions (22)Used By (2)

Securilex
=========

[](#securilex)

[![Packagist Version](https://camo.githubusercontent.com/8dc9e702cdc708d58d686b2df51d934769275365e4cda6d35a0eb3710c457cdf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6c756b6d616e2f7365637572696c65782e737667)](https://packagist.org/packages/mlukman/securilex) [![Build Status](https://camo.githubusercontent.com/178d4b320dffcdcc9724c53f4de4e5fbbac8f06d4e733658b877e33649623b01/68747470733a2f2f7472617669732d63692e6f72672f4d4c756b6d616e2f5365637572696c65782e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/MLukman/Securilex)

Securilex is a simplified security provider for Silex.

The main class for Securilex is `\Securilex\SecurityServiceProvider`.

Usage:

```
// $app is instance of \Silex\Application
$app->register(new \Securilex\ServiceProvider());

// securilex is now a service
$app['securilex']-> ...

```

Authentication
--------------

[](#authentication)

Authentication deals with identifying user identity via login mechanism. The main class for authentication is `\Securilex\Firewall`.

To define a firewall, you need to define four items:

1. **The path(s) to secure**: whether the whole site (/) or just specific area (/admin/).
2. **The path to login page** = optional, if none specific it will use browser login popup (i.e. Basic HTTP Authentication).
3. **The authentication factory** = method of authentication, e.g. plaintext password validation, encoded password validation, LDAP, OAuth etc.
4. **The user provider** = source to get the list of users, e.g. hard-coded, database etc.

The first two items are required when constructing a Firewall:

```
$firewall = new \Securilex\Firewall('/secure/', '/login/');

```

You can define multiple secure paths to be under the same firewall:

```
$firewall = new \Securilex\Firewall(array('/secure/', '/admin/'), '/login/');

```

The next two items are to be passed to `addAuthenticationFactory` method:

```
$firewall->addAuthenticationFactory($authFactory, $userProvider);

```

Register the firewall to securilex using `addFirewall()` method:

```
$app['securilex']->addFirewall($firewall);

```

### Authentication Factory

[](#authentication-factory)

Authentication Factory defines the method of authentication of user credentials. Securilex comes with a few ready-to-use authentication factories:

- **PlaintextPasswordAuthenticationFactory** - simply compares the entered password with the stored plaintext password.
- **LdapBindAuthenticationFactory** - authenticates login using external LDAP service.
- **InitializableAuthenticationFactory** - provides authentication mechanism that remembers the first password that users enter after registration/resetting the password. Requires a user provider that implements `MutableUserProviderInterface` (will be further explained in the next section).
- **SimpleAuthenticationFactory** - delegates authentication to another class that implements `SimpleAuthenticatorInterface`.

You can create additional factories by:

1. implementing `AuthenticationFactoryInterface` (`LdapBindAuthenticationFactory` does this), or
2. extending `SimpleAuthenticationFactory` while implementing `SimpleAuthenticatorInterface` (`PlaintextPasswordAuthenticationFactory` and `InitializableAuthenticationFactory` do this).

### User Provider

[](#user-provider)

User Provider provides the list of users who have access to the corresponding firewall. Securilex supports all Symfony's existing user providers while it also provides additional ones:

- **NoPasswordUserProvider** - when the application cannot know the passwords of the users, for example when using `LdapBindAuthenticationFactory`.
- **UserProviderSegmentalizer** - when a list of users needs to be segmentalized to be authenticated by different authentication factories. Instead of defining two user providers with slightly different parameters and potentially causing redundant calls to database or external source, using segmentalizer will cache the user data while it is being authenticated by multiple authentication factories.

Authorization
-------------

[](#authorization)

Authorization deals with allowing or denying access to page or resource.

// TODO: Work In Progress

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity67

Established project with proven stability

 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 ~78 days

Recently: every ~263 days

Total

20

Last Release

2192d ago

Major Versions

0.3.0 → 1.0.02016-06-06

PHP version history (2 changes)0.1.0PHP &gt;=5.4.0

1.2.8PHP &gt;=5.6.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/177263?v=4)[Muhammad Lukman Nasaruddin](/maintainers/MLukman)[@MLukman](https://github.com/MLukman)

---

Top Contributors

[![MLukman](https://avatars.githubusercontent.com/u/177263?v=4)](https://github.com/MLukman "MLukman (33 commits)")

---

Tags

authentication-factoriesfirewallsecuritysilexsecuritysilexsecurilex

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mlukman-securilex/health.svg)

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

###  Alternatives

[phpseclib/phpseclib

PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.

5.6k455.2M1.5k](/packages/phpseclib-phpseclib)[defuse/php-encryption

Secure PHP Encryption Library

3.9k170.7M239](/packages/defuse-php-encryption)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k18.0M137](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41182.2M138](/packages/robrichards-xmlseclibs)[spatie/laravel-csp

Add CSP headers to the responses of a Laravel app

86110.6M23](/packages/spatie-laravel-csp)

PHPackages © 2026

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