PHPackages                             dilsonjlrjr/slim3-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. dilsonjlrjr/slim3-auth

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

dilsonjlrjr/slim3-auth
======================

Slim Auth

1.1(9y ago)7284↓90%11MITPHPPHP &gt;=7.0

Since Sep 3Pushed 9y ago2 watchersCompare

[ Source](https://github.com/dilsonjlrjr/slim3-auth)[ Packagist](https://packagist.org/packages/dilsonjlrjr/slim3-auth)[ RSS](/packages/dilsonjlrjr-slim3-auth/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (2)Versions (3)Used By (1)

slim3-auth
==========

[](#slim3-auth)

Module Auth Slim 3

### Installation:

[](#installation)

You can install the library directly from composer / packagist:

```
$ composer require "dilsonjlrjr/slim3-auth"

```

### Dependencies:

[](#dependencies)

- [Slim Session](https://github.com/akrabat/rka-slim-session-middleware)
- PHP 7

### Usage:

[](#usage)

The slim3 -auth uses three components in your authentication process:

- Adapter
- AuthResponse
- FacadeAuth

#### Adapters:

[](#adapters)

The adaptares are responsible for defining the authentication rules. Every adapter implements **AuthAdapterInterface** interface and uses its constructor as input. All adapter should return a type **AuthResponse** object. Below an adapter instance.

```
use SlimAuth\AuthResponse;
use SlimAuth\AuthAdapterInterface;

class AuthTestAdapter implements AuthAdapterInterface
{

    private $username;

    private $password;

    /**
     * AuthTestAdapter constructor.
     * Data entry
     * @param string $username
     * @param string $password
     */
    public function __construct(string $username, string $password)
    {
        $this->username = $username;
        $this->password = $password;
    }

    function authenticate() : AuthResponse
    {
        if ($this->username == 'username' && $this->password == 'password') {
            return new AuthResponse(AuthResponse::AUTHRESPONSE_SUCCESS, 'User auth success', 'Slim3Auth', [ 'id' => 1010 ]);
        }

        return new AuthResponse(AuthResponse::AUTHRESPONSE_FAILURE, 'Failure');
    }

}
```

##### Adapters - Methods

[](#adapters---methods)

**authenticate**

```
Define:
	Authenticates according to the rules defined in the implemented class
Params:
	no params;
Return:
	SlimAuth\AuthResponse

```

---

#### AuthResponse

[](#authresponse)

The AuthResponse class indicates the result of the authentication process. It has constants that define states, AUTHRESPONSE\_SUCCESS (Successful authentication), AUTHRESPONSE\_FAILURE (Authentication failed).

##### AuthResponse - Methods

[](#authresponse---methods)

**\_\_construct**

```
Define:
	Set message result autenticate
Params:
	$code [int] - AUTHRESPONSE_SUCCESS or AUTHRESPONSE_FAILURE;
	$message [string] - Defined user. Message result authentication;
	$keyAttributeSession [string] - Key used for session rescue;
	$attributesSession [array] - Array with attributes session;
Return:
	no returns;

```

**setMessage**

```
Define:
	Set message result autenticate
Params:
	$code [int] - AUTHRESPONSE_SUCCESS or AUTHRESPONSE_FAILURE;
	$message [string] - Defined user. Message result authentication;
	$keyAttributeSession [string] - Key used for session rescue;
	$attributesSession [array] - Array with attributes session;
Return:
	no returns;

```

**getMessage**

```
Define:
	Get array message
Params:
	no params;
Return:
	no returns;
Example:
	[
		$code, [int]
		$message, [string]
		$keyAttributeSession, [string]
		$attributesSession, [array]
	]

```

---

#### FacadeAuth:

[](#facadeauth)

This facade runs an adapter set in advance and stored in session attributes set by the adapter.

##### FacadeAuth - Methods

[](#facadeauth---methods)

**\_\_construct**

```
Define:
	The class constructor
Params:
	$authAdapter [SlimAuth\AuthAdapterInterface] - implemented adapter interface SlimAuth\AuthAdapterInterface;
	$session [RKA\Session] - Stored Session

Return:
	no returns;

```

**auth**

```
Define:
	Auth method
Params:
	no params;
Return:
	no returns;

```

**isValid**

```
Define:
	It indicates whether the authentication was valid
Params:
	no params;
Return:
	boolean;

```

---

Contact:

```
Email: dilsonjlrjr@gmail.com

```

###  Health Score

30

—

LowBetter than 61% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community11

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

Total

2

Last Release

3619d ago

### Community

Maintainers

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

---

Top Contributors

[![dilsonjlrjr](https://avatars.githubusercontent.com/u/7747387?v=4)](https://github.com/dilsonjlrjr "dilsonjlrjr (2 commits)")

### Embed Badge

![Health badge](/badges/dilsonjlrjr-slim3-auth/health.svg)

```
[![Health](https://phpackages.com/badges/dilsonjlrjr-slim3-auth/health.svg)](https://phpackages.com/packages/dilsonjlrjr-slim3-auth)
```

###  Alternatives

[vitalybaev/laravel5-dkim

Laravel 5/6 package for signing outgoing messages with DKIM.

3163.1k](/packages/vitalybaev-laravel5-dkim)[firemultimedia/mautic-multi-captcha-bundle

This plugin brings Google's reCAPTCHA, hCaptcha, and Cloudflare Turnstile integration to mautic.

151.4k](/packages/firemultimedia-mautic-multi-captcha-bundle)

PHPackages © 2026

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