PHPackages                             rederlo/t-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. rederlo/t-auth

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

rederlo/t-auth
==============

Auth plugin for CakePHP

013PHP

Since Apr 28Pushed 9y ago2 watchersCompare

[ Source](https://github.com/rederlo/TAuth)[ Packagist](https://packagist.org/packages/rederlo/t-auth)[ RSS](/packages/rederlo-t-auth/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

TAuth
=====

[](#tauth)

in config/bootstrap.php
-----------------------

[](#in-configbootstrapphp)

```
//Enable Cors

DispatcherFactory::add('TAuth.Cors', ['priority' => 1]);
//Enable plugin

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

in src/AppController.php
------------------------

[](#in-srcappcontrollerphp)

```
use \TAuth\Controller\AuthTrait;
```

```
    public function initialize()
    {
        parent::initialize();
        $auth = new \TAuth\Controller\AuthBuilder([
            'model' => 'peoples',
            'scope_auth' => ['username' => 'email'],
            'scope_jwt' => ['username' => 'id']
        ]);

        $this->loadComponent('Auth', $auth->getConfig());
    }
```

is get user id
--------------

[](#is-get-user-id)

```
    public function getUserId()
    {
        return $this->getUser();
    }
```

Generate database
-----------------

[](#generate-database)

```
bin/cake migrations migrate --plugin TAuth
```

Generate data in tables
-----------------------

[](#generate-data-in-tables)

```
bin/cake migrations seed --seed  --plugin TAuth
```

New User
--------

[](#new-user)

```
public function add()
{
    $users = $this->Users->newEntity();
    if($this->request->is('post')){
        $users = $this->Users->patchEntity($users, $this->request->data());
        if ($this->Users->save($users)) {
            $auth = new AuthFactory();
            //Expected Type Entity
            $auth->create($users);
            $token = $auth->build();
        }
    }
    $this->set(compact('token'));
    $this->set('_serialize', ['token']);
}
```

Login
-----

[](#login)

```
public function login()
{
    if ($this->request->is('post')) {
        $user = $this->Auth->identify();
        if ($user) {
            $this->Auth->setUser($user);
            return $this->redirect($this->Auth->redirectUrl());
        }
        $this->Flash->error(__('Usernamme or password ínvalid, try again.'));
    }
}

```

Authorized
----------

[](#authorized)

```
/**
* @param $user
* @return bool
*/
public function isAuthorized($user)
{
    return (new Authorize($this, $user['id']))->exec();
}
```

Params token
------------

[](#params-token)

```
$auth = new AuthFactory();
$auth->create($users, ['group_id' => $group_id]);
```

GetParamsToken
--------------

[](#getparamstoken)

```
/**
* @return Array
*/
$this->getParamsHeader();
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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/b538eaafca28c7078acde17db6e1f71aa4c437a082b6710bb889e4b22b8f7c7f?d=identicon)[rederlo](/maintainers/rederlo)

---

Top Contributors

[![rederlo](https://avatars.githubusercontent.com/u/12686085?v=4)](https://github.com/rederlo "rederlo (6 commits)")

### Embed Badge

![Health badge](/badges/rederlo-t-auth/health.svg)

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

###  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)
