PHPackages                             agungsugiarto/codeigniter4-authentication - 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. agungsugiarto/codeigniter4-authentication

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

agungsugiarto/codeigniter4-authentication
=========================================

Provides an API for authentication and includes concrete authentication adapters for common use case scenarios

v2.1.0(2y ago)494.5k10[2 issues](https://github.com/agungsugiarto/codeigniter4-authentication/issues)2MITPHPPHP ^7.3 || ^8.0

Since Mar 2Pushed 2y ago4 watchersCompare

[ Source](https://github.com/agungsugiarto/codeigniter4-authentication)[ Packagist](https://packagist.org/packages/agungsugiarto/codeigniter4-authentication)[ Fund](https://saweria.co/agungsugiarto)[ RSS](/packages/agungsugiarto-codeigniter4-authentication/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (16)Used By (2)

CodeIgniter4 Authentication
===========================

[](#codeigniter4-authentication)

[![tests](https://github.com/agungsugiarto/codeigniter4-authentication/actions/workflows/php.yml/badge.svg)](https://github.com/agungsugiarto/codeigniter4-authentication/actions/workflows/php.yml)[![Latest Stable Version](https://camo.githubusercontent.com/c1afb63f62a0bbc9e7fa832f2c243272ca5249e8560ccb64c3dcea1393933b66/68747470733a2f2f706f7365722e707567782e6f72672f6167756e67737567696172746f2f636f646569676e69746572342d61757468656e7469636174696f6e2f76)](https://github.com/agungsugiarto/codeigniter4-authentication/releases)[![Total Downloads](https://camo.githubusercontent.com/9d1208d32e18379f998202117495bb26c8ba62a0494327a11f8cb001fffe4810/68747470733a2f2f706f7365722e707567782e6f72672f6167756e67737567696172746f2f636f646569676e69746572342d61757468656e7469636174696f6e2f646f776e6c6f616473)](https://packagist.org/packages/agungsugiarto/codeigniter4-authentication/stats)[![Latest Unstable Version](https://camo.githubusercontent.com/a3332451d06a31db55912ab61b6737960fb987dd112e1bb7154d7ccd83e731d3/68747470733a2f2f706f7365722e707567782e6f72672f6167756e67737567696172746f2f636f646569676e69746572342d61757468656e7469636174696f6e2f762f756e737461626c65)](https://packagist.org/packages/agungsugiarto/codeigniter4-authentication)[![License](https://camo.githubusercontent.com/1b9e1d33e7a075c9c34a91e152fb916845f7bb6ed0b8952a0ed9fd7ff587d35b/68747470733a2f2f706f7365722e707567782e6f72672f6167756e67737567696172746f2f636f646569676e69746572342d61757468656e7469636174696f6e2f6c6963656e7365)](https://github.com/agungsugiarto/codeigniter4-authentication/blob/master/LICENSE.md)

About
-----

[](#about)

The `codeigniter4\authentication` component provides an API for authentication and includes concrete authentication adapters for common use case scenarios.

- Inspired from
- Most inspired from auth by laravel

Upgrade from v1.x to 2.x
------------------------

[](#upgrade-from-v1x-to-2x)

### Composer Dependencies

[](#composer-dependencies)

You should update the following dependencies in your application's composer.json file:

`agungsugiarto/codeigniter4-authentication` to `^2.0`

### User Entity

[](#user-entity)

Open class `App\Entities\User` add interface and trait to implement.

```
namespace Fluent\Auth\Entities;

- use CodeIgniter\Entity;
+ use CodeIgniter\Entity\Entity;
use Fluent\Auth\Contracts\AuthenticatorInterface;
+ use Fluent\Auth\Contracts\AuthorizableInterface;
use Fluent\Auth\Contracts\HasAccessTokensInterface;
use Fluent\Auth\Contracts\ResetPasswordInterface;
use Fluent\Auth\Contracts\VerifyEmailInterface;
use Fluent\Auth\Facades\Hash;
use Fluent\Auth\Traits\AuthenticatableTrait;
use Fluent\Auth\Traits\AuthorizableTrait;
use Fluent\Auth\Traits\CanResetPasswordTrait;
use Fluent\Auth\Traits\HasAccessTokensTrait;
use Fluent\Auth\Traits\MustVerifyEmailTrait;

class User extends Entity implements
    AuthenticatorInterface,
+   AuthorizableInterface,
    HasAccessTokensInterface,
    ResetPasswordInterface,
    VerifyEmailInterface
{
    use AuthenticatableTrait;
+   use AuthorizableTrait;
    use CanResetPasswordTrait;
    use HasAccessTokensTrait;
    use MustVerifyEmailTrait;
}
```

### AuthServiceProvider

[](#authserviceprovider)

Open `App\Providers\AuthServiceProvider`

```
namespace Fluent\Auth;

+ use Fluent\Auth\Facades\Gate;
use Fluent\Auth\AbstractServiceProvider;

class AuthServiceProvider extends AbstractServiceProvider
{
+   /**
+    * The policy mappings for the application.
+    *
+    * @var array
+    */
+   protected static $policies = [];

    /**
     * {@inheritdoc}
     */
    public static function register()
    {
+        static::registerPolicies();
    }
}
```

Documentation
-------------

[](#documentation)

- [Authentication](docs/en/authentication.md)
- [Authorization](docs/en/authorization.md)

Community Authentication Guards
-------------------------------

[](#community-authentication-guards)

- JWT (JSON Web Token) - [agungsugiarto/codeigniter4-authentication-jwt](https://github.com/agungsugiarto/codeigniter4-authentication-jwt)

Authentication Demo
-------------------

[](#authentication-demo)

- [codeigniter4-authentication-demo](https://github.com/agungsugiarto/codeigniter4-authentication-demo)

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Contributions are very welcome.

License
-------

[](#license)

Released under the MIT License, see [LICENSE](LICENSE.md).

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 99.4% 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

Every ~79 days

Recently: every ~133 days

Total

15

Last Release

797d ago

Major Versions

v1.0.8 → v2.0.02022-04-11

1.x-dev → 2.x-dev2024-03-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/d4650dfd30af25f75c8de8060b618e9773614a818000afeb21a9346c73955167?d=identicon)[agungsugiarto](/maintainers/agungsugiarto)

---

Top Contributors

[![agungsugiarto](https://avatars.githubusercontent.com/u/10989147?v=4)](https://github.com/agungsugiarto "agungsugiarto (156 commits)")[![bhargavraviya](https://avatars.githubusercontent.com/u/46953122?v=4)](https://github.com/bhargavraviya "bhargavraviya (1 commits)")

---

Tags

authauthenticationcodeigniter4authAuthenticationcodeigniter4

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/agungsugiarto-codeigniter4-authentication/health.svg)

```
[![Health](https://phpackages.com/badges/agungsugiarto-codeigniter4-authentication/health.svg)](https://phpackages.com/packages/agungsugiarto-codeigniter4-authentication)
```

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M350](/packages/tymon-jwt-auth)[league/oauth2-server

A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.

6.6k136.0M248](/packages/league-oauth2-server)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

8359.8M53](/packages/php-open-source-saver-jwt-auth)[auth0/auth0-php

PHP SDK for Auth0 Authentication and Management APIs.

40820.2M68](/packages/auth0-auth0-php)[kreait/firebase-tokens

A library to work with Firebase tokens

24040.8M14](/packages/kreait-firebase-tokens)[auth0/login

Auth0 Laravel SDK. Straight-forward and tested methods for implementing authentication, and accessing Auth0's Management API endpoints.

2745.0M3](/packages/auth0-login)

PHPackages © 2026

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