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(13y ago)120WTFPLPHPPHP &gt;=5.3.0

Since Jul 9Pushed 13y 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 2w 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

23

—

LowBetter than 25% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

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

4785d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3182?v=4)[Diosdado D. Campo](/maintainers/pyodor)[@pyodor](https://github.com/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

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.6k10](/packages/helsingborg-stad-municipio)[markstory/acl_extras

Additional tools for managing DB ACL in CakePHP applications.

154315.4k](/packages/markstory-acl-extras)[rainlab/user-plugin

User plugin for October CMS

11855.3k17](/packages/rainlab-user-plugin)[dereuromark/cakephp-tinyauth

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

131242.7k13](/packages/dereuromark-cakephp-tinyauth)[ivanamat/cakephp3-aclmanager

AclManager plugin for CakePHP 3.x

2716.2k2](/packages/ivanamat-cakephp3-aclmanager)[pressbooks/pressbooks-book

This theme is named after Canadian media theorist Marshall McLuhan, who coined the phrase “the medium is the message.” It is designed for academic writing and is also suitable for fiction. Headings are set in Cormorant Garamond, and body type is set in Lora.

226.7k](/packages/pressbooks-pressbooks-book)

PHPackages © 2026

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