PHPackages                             pyodor/nano-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. pyodor/nano-auth

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

pyodor/nano-auth
================

CakePHP Authentication Plugin with ACL

0.2.1(12y ago)020WTFPLPHPPHP &gt;=5.3.0

Since Jul 9Pushed 12y ago1 watchersCompare

[ Source](https://github.com/pyodor/nano-auth)[ Packagist](https://packagist.org/packages/pyodor/nano-auth)[ Docs](https://github.com/pyodor/nano-auth)[ RSS](/packages/pyodor-nano-auth/feed)WikiDiscussions master Synced 2mo ago

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

Welcome to NanoAuth a CakePHP Plugin
====================================

[](#welcome-to-nanoauth-a-cakephp-plugin)

`NanoAuth` is an Authenctication Plugin for CakePHP that utilizes and wraps Auth and ACL Component of the framework.

Features
--------

[](#features)

- Full CRUD user management with pagination
- Utilizes CakePHP Auth Component
- Supports app level configuration (i.e setting landing page after login or logout)
- Forgot Password feature (sends password reset code through email)
- Password Reset page (using the password reset code)
- With Unit &amp; Functional Testing and Code Coverage (in progress)
- ACL

Installation - Composer
-----------------------

[](#installation---composer)

Ensure `require` is present in `composer.json`. This will install the plugin into `Plugin/NanoAuth`:

```
{
    "require": {
        "pyodor/nano-auth": "0.2.*"
    }
}
```

Get composer and install:

```
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar install
```

Installation - Git
------------------

[](#installation---git)

Make sure you properly baked your app:

```
cake bake myapp
```

and provide the following parameters for your `myapp`, database setup and some other stuffs.

Clone the plugin inside your `myapp/Plugin` directory:

```
git clone https://github.com/pyodor/nano-auth.git NanoAuth
```

In your `myapp/Config/bootstrap.php` add this:

```
CakePlugin::loadAll(array(
    'NanoAuth' => array('bootstrap' => false, 'routes' => true)
));
```

Migrate `NanoAuth`'s schema, issue this inside your `myapp`:

```
Console/cake schema create --plugin NanoAuth
```

this will drop and recreates 4 tables:

```
acos
aros
aros_acos
users
```

Usage
-----

[](#usage)

Adding your first user the administrator, navigate to:

```
/users/add
```

and provide the username, password, email and select Administrator in Group, click submit.

Locking the `users` controller after adding administrator, navigate to `/login` and provide the administrator credentials you created then navigate to `/controllers/add` type `users` on the Alias then submit. Then navigate to `/acl/add` and provide the following:

```
Group => Administrator
Controller => users
Create => 1
Read => 1
Update => 1
Delete => 1
```

the above values are making the Administrator Group to have full access on the users management module. To know more on acl module read the ACL documentation.

Routes available:

```
/login
/logout
/forgot_password
/password_reset/*
/users/:action/*
/groups/:action/*
/controllers/:action/*
/acl/:action/*
```

Accessing the authentication page:

```
http://your-app-url/login
http://your-app-url/logout
```

You may want to make your own route for the login/logout page just add this on your `myapp/Config/routes.php`:

```
Router::connect('/anything-you-like', array('plugin' => 'nano_auth', 'controller' => 'users', 'action' => 'login'));
```

You can access logged-in user in your controller like this:

```
App::uses('AuthComponent', 'Controller/Component');

$user = AuthComponent::user();
if(!$user) { // user not logged-in
    $this->redirect('/login');
}
debug($user); // see what's inside user
```

Accessing `NanoAuth`'s User model from your app controller:

```
public $uses = array('NanoAuth.User');

public function index() {
    debug($this->User->find('all'));
}
```

Relating `NanoAuth`'s User model with your `myapp` models, for example:

```
// Inside your app Profile model
class Profile extends AppModel {
    public $belongsTo = array(
        'User'
    );
}

// And then accessing it on the controller
public $uses = array('NanoAuth.User', 'Profile');

public function index() {
    debug($this->Profile->find('all'));
}
```

Linking associations `NanoAuth`'s User model with your `myapp` models using Configurations, for example:

```
Configure::write('NanoAuth', array(
    'userAssoc' => array(
        'hasOne' => array('Profile'), // only hasOne is supported for now
    )
));
```

ACL
---

[](#acl)

Inside your AppController add `NanoAuth.NaAcl`:

```
public $components = array('NanoAuth.NaAcl');
```

Any controller you have in your app that was entered on the `NanoAuth` backend will be ACLified

Configuration
-------------

[](#configuration)

Default page after login and logout is `users/index` of `NanoAuth`'s plugin, to configure your own landing page add this on your `myapp/Config/core.php`:

```
Configure::write('NanoAuth', array(
    'loginRedirect' => array('controller' => 'my_controller', 'action' => 'index'),
    'logoutRedirect' => array('controller' => 'my_other_Controller', 'action' => 'index'),
));
```

For forgot password feature, the sending of email by default is in debug mode, to enable this in production add this in your `myapp/Config/core.php` under `NanoAuth`'s configuration:

```
'email_sending' => true,
```

Tests
-----

[](#tests)

Make sure you installed properly `PHPUnit` and `Xdebug` for testing To run the tests using web runner access the test page of your `myapp`:

```
http://myapp.com/test.php
```

and run all the tests under `Plugins->NanoAuth`.

TODO
----

[](#todo)

- Unit Testing and Code Coverage
- Custom template
- API (json, xml) generator for front-end use

License
-------

[](#license)

`NanoAUth` is released under the [WTFPL](http://sam.zoy.org/wtfpl/) license.

Support
-------

[](#support)

Send [me](mailto:csicebu@gmail.com) a bottle of beer or [FORK](https://github.com/pyodor/nano-auth) it! :)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

4693d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4bde3b43170068791e03359e7b8e1507dfdb837d34d002b3ee1aae5462ac8661?d=identicon)[pyodor](/maintainers/pyodor)

---

Top Contributors

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

---

Tags

cakephpaclauthenctication

### Embed Badge

![Health badge](/badges/pyodor-nano-auth/health.svg)

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

###  Alternatives

[markstory/acl_extras

Additional tools for managing DB ACL in CakePHP applications.

155311.0k](/packages/markstory-acl-extras)[dereuromark/cakephp-tinyauth

A CakePHP plugin to handle user authentication and authorization the easy way.

129228.6k10](/packages/dereuromark-cakephp-tinyauth)[webtechnick/cakephp-facebook-plugin

CakePHP Facebook Plugin

43712.3k](/packages/webtechnick-cakephp-facebook-plugin)[ivanamat/cakephp3-aclmanager

AclManager plugin for CakePHP 3.x

2715.2k](/packages/ivanamat-cakephp3-aclmanager)[josegonzalez/cakephp-annotation-control-list

ACL system based on annotations for CakePHP

211.4k](/packages/josegonzalez-cakephp-annotation-control-list)

PHPackages © 2026

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