PHPackages                             felipepanegalli/authenticator-cakephp-3 - 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. felipepanegalli/authenticator-cakephp-3

ActiveCakephp-plugin[Authentication &amp; Authorization](/categories/authentication)

felipepanegalli/authenticator-cakephp-3
=======================================

Authenticator plugin for CakePHP

06PHP

Since Jan 9Pushed 8y agoCompare

[ Source](https://github.com/felipepanegalli/authenticator-cakephp-3)[ Packagist](https://packagist.org/packages/felipepanegalli/authenticator-cakephp-3)[ RSS](/packages/felipepanegalli-authenticator-cakephp-3/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Authenticator plugin for CakePHP 3
==================================

[](#authenticator-plugin-for-cakephp-3)

Instalação
----------

[](#instalação)

#### Plugin desenvolvido por Felipe Panegalli

[](#plugin-desenvolvido-por-felipe-panegalli)

#####

[](#httppanegalliesyes)

Para instalar esse pacote, baixe o composer e execute o seguinte comando para instalação:

```
composer require felipepanegalli/authenticator-cakephp-3:dev-master

```

Após o download, deve-se ativar o plugin no final do arquivo bootstrap em `config/bootstrap.php`

```
Plugin::load('Authenticator', ['bootstrap' => false, 'routes' => true]);

```

Primeiramente deve-se gerar o banco com o comando:

```
bin/cake migrations migrate --plugin=Authenticator

```

Logo após, gerar os Seeds com o comando

```
bin/cake migrations seed --plugin=Authenticator

```

Quando é gerado o Seed do plugins, são adicionados dois registros de usuário ao banco, o admin e user, para ambos, a senha é o mesmo que o username ou seja, o admin é admin e o user é user.

Após ativado o plugins, nenhum controller irá permitir o acesso, para isso basta adicionar a seguinte função nos controller que deseja controllar o acesso:

```
public function isAuthorized($user)
{
   //Verifica qual é a action
   $action = $this->request->getParam('action');
   //Carrega o Model de Regras
   $this->loadModel('Authenticator.AuthRoles');
   //Carrega a ragra baseado na role_id do usuário
   $role = $this->Roles->find()->where(['id' => $this->Auth->user('role_id')])->first();

   //Verifica se o usuário é administrador e está nas actions do array, permite o acesso das actions inclusas
   if (strtolower($role['title']) == 'administrator' and in_array($action, ['index', 'view', 'add', 'edit', 'delete'])) {
       return true;

   //Verifica se o usuário é usuario e está nas actions do array, permite o acesso das actions inclusas
   } elseif (strtolower($role['title']) == 'user' and in_array($action, ['index', 'view'])) {
       return true;

   //Se nenhuma das condições foram True, nega o acesso
   } else {
       return false;
   }

   //Aqui vai alguma validação caso necessário...
}

```

Se for necessário fazer alguma alteração de model para acesso ao usuário, verifica a pasta raiz do plugin em `/vendor/felipepanegalli/authenticator-cakephp-3/src/Controller/AppController.php`

Para acessar o login basta entrar no endereço `site.com.br/login` ou no localhost `localhost:8765/login`

Qualquer dúvida pode ser enviado na aba de contato no site acima.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.1% 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/d803df648d7f31d6e9d2d68128321cd0609c9be846acc5d76dab02a880b759d3?d=identicon)[felipepanegalli](/maintainers/felipepanegalli)

---

Top Contributors

[![felipepanegalli](https://avatars.githubusercontent.com/u/25158249?v=4)](https://github.com/felipepanegalli "felipepanegalli (4 commits)")[![felipepanegalli-iffar](https://avatars.githubusercontent.com/u/271609303?v=4)](https://github.com/felipepanegalli-iffar "felipepanegalli-iffar (3 commits)")

### Embed Badge

![Health badge](/badges/felipepanegalli-authenticator-cakephp-3/health.svg)

```
[![Health](https://phpackages.com/badges/felipepanegalli-authenticator-cakephp-3/health.svg)](https://phpackages.com/packages/felipepanegalli-authenticator-cakephp-3)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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