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

ActiveLibrary

rederlo/cake-auth-jwt
=====================

CakePHP plugin for authenticating using JSON Web Tokens and others features

017PHP

Since Apr 13Pushed 9y ago1 watchersCompare

[ Source](https://github.com/rederlo/cake-auth-jwt)[ Packagist](https://packagist.org/packages/rederlo/cake-auth-jwt)[ RSS](/packages/rederlo-cake-auth-jwt/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)DependenciesVersions (1)Used By (0)

Installation
------------

[](#installation)

```
composer require rederlo/cake-auth-jwt
```

Config
------

[](#config)

```
// src/AppController.php

use AuthTrait;

public function initialize()
{
  parent::initialize();
  Auth::create($this, [
      'model' => 'Users',
      'scope_auth' => ['username' => 'email'],
      'scope_jwt' => ['username' => 'id'],
  ]);
}
```

\#cross-origin HTTP request use

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.'));
    }
}

```

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

Popularity6

Limited adoption so far

Community7

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

### Embed Badge

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

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

PHPackages © 2026

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