PHPackages                             faqzul/codeigniter-fauthz-library - 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. faqzul/codeigniter-fauthz-library

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

faqzul/codeigniter-fauthz-library
=================================

CodeIgniter Auth Library

0.1.0(5y ago)011MITPHPPHP &gt;=5.4.8

Since Jun 1Pushed 5y ago1 watchersCompare

[ Source](https://github.com/FaqZul/CodeIgniter-FauthZ-Library)[ Packagist](https://packagist.org/packages/faqzul/codeigniter-fauthz-library)[ Docs](https://github.com/FaqZul/CodeIgniter-FauthZ-Library)[ RSS](/packages/faqzul-codeigniter-fauthz-library/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

CodeIgniter-FauthZ-Library
==========================

[](#codeigniter-fauthz-library)

[![Build Status](https://camo.githubusercontent.com/d67f35511b4d83677bffb5563701744b42e629bb7c52945fd2779682a298f16c/68747470733a2f2f7472617669732d63692e6f72672f4661715a756c2f436f646549676e697465722d46617574685a2d4c6962726172792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/FaqZul/CodeIgniter-FauthZ-Library)

Authentication library for PHP-Framework [CodeIgniter](https://www.codeigniter.com). It's based on [Tank Auth](https://konyukhov.com/soft/tank_auth/), although the code was seriously reworked.

Prerequisites
-------------

[](#prerequisites)

- PHP version 5.6 or newer is recommended.
    It should work on 5.4.8 as well, but we strongly advise you NOT to run such old versions of PHP, because of potential security and performance issues, as well as missing features.
- [CodeIgniter 3.x](https://github.com/bcit-ci/CodeIgniter)
- [CodeIgniter-CRUD-Model ~3.2.0](https://github.com/FaqZul/CodeIgniter-CRUD-Model)
- [MariaDB ^10.2.7](https://mariadb.com/downloads/)

Feature
-------

[](#feature)

### It's simple

[](#its-simple)

- Basic auth options ([register](#register), [login](#login), [logout](#logout), [unregister](#unregister)).
- Username is optional, only email is obligatory.

### It's secure

[](#its-secure)

- Using phpass library for password hashing (instead of unsafe md5).
- Counting login attempt for bruteforce preventing (optional). Failed login attempt determined by IP and by username.
- Logging last login IP-address and time (optional).
- CAPTCHA for registration and repetitive login attempt (optional).
- Unactivated accounts and forgotten password requests auto-expire.

### It's easy to manage

[](#its-easy-to-manage)

- Strict MVC Model: [controller](https://github.com/FaqZul/CodeIgniter-FauthZ-Library/tree/0.1.0/controllers) for controlling, [views](https://github.com/FaqZul/CodeIgniter-FauthZ-Library/tree/0.1.0/views) for representation and library as model interface.
- Language file support.
- View files contain only necessary HTML code without redundant decoration.
- Most of the features are optional and can be turned or switched-off in well-documented config file.

### It's full featured

[](#its-full-featured)

- Login using username, email address or both (depending on config settings).
- Registration is instant or after activation by email (optional).
- "Remember me" option.
- Forgot password (letting users pick a new password upon reactivation).
- Changed email or password for registered users.
- Email or password can be changed even before account is activated.
- Ban user (optional).
- User profile (optional).
- CAPTCHA support.
- HTML or plain-text emails.

Getting Started
---------------

[](#getting-started)

### Composer

[](#composer)

```
faqzul@Trisquel:/var/www/CodeIgniter$ composer require faqzul/codeigniter-fauthz-library
```

### Manual

[](#manual)

1. [Download](https://github.com/FaqZul/CodeIgniter-FauthZ-Library/releases/latest) the latest version of the library.
2. Unzip the package to application/third\_party/.
3. [Download](https://github.com/FaqZul/CodeIgniter-CRUD-Model/releases/latest) the latest version of [CodeIgniter-CRUD-Model](https://github.com/FaqZul/CodeIgniter-CRUD-Model/releases).
4. Unzip the package [CodeIgniter-CRUD-Model](https://github.com/FaqZul/CodeIgniter-CRUD-Model) to application/third\_party/.

And then install database schema into Your [MariaDB](https://github.com/FaqZul/CodeIgniter-FauthZ-Library/blob/0.1.0/sql/mariadb.sql) database.

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

[](#configuration)

### Composer

[](#composer-1)

Change the following line in the `application/config/autoload.php` file for use in Your controller class.

```
$autoload['packages'] = array();
↓
$autoload['packages'] = array(FCPATH . 'vendor/faqzul/codeigniter-fauthz-library/');
```

#### Setting FauthZ Preferences

[](#setting-fauthz-preferences)

```
$this->load->library('fauthz');
$this->fauthz->config_set('website_mail', 'web@domain.com');
$this->fauthz->config_set('website_name', 'CodeIgniter Authentication');
$this->fauthz->config_set('captcha_registration', TRUE);
```

And more preferences You can see at [config/fauthz.php](https://github.com/FaqZul/CodeIgniter-FauthZ-Library/blob/0.1.0/config/fauthz.php).

### Manual

[](#manual-1)

- Change the following line in the `application/config/autoload.php` file for use in Your controller class.

```
$autoload['packages'] = array();
↓
$autoload['packages'] = array(APPPATH . 'third_party/codeigniter-fauthz-library/');
```

- Change the following line in the `application/third_party/codeigniter-fauthz-library/config/fauthz.php`.

```
$config['crud_path'] = FCPATH . 'vendor/faqzul/codeigniter-crud-model/';
↓
$config['crud_path'] = APPPATH . 'third_party/codeigniter-crud-model/';
```

Usage
-----

[](#usage)

### [register](https://github.com/FaqZul/CodeIgniter-FauthZ-Library/blob/0.1.0/controllers/Fauth.php#L71)

[](#register)

Register user on the site. If registration is successfull, a new user account is created. If **[email\_activation](https://github.com/FaqZul/CodeIgniter-FauthZ-Library/blob/0.1.0/config/fauthz.php#L53)** flag in config-file is set to TRUE, then this account have to be activated by clicking special link sent by email; otherwise it is activated already. Please notice: after registration user remains unauthenticated; login is still required.

### [login](https://github.com/FaqZul/CodeIgniter-FauthZ-Library/blob/0.1.0/controllers/Fauth.php#L27)

[](#login)

Login user on the site. If login is successfull and user account is activated, s/he is redirected to the home page. If account is not activated, then **[send\_again](#send_again)** is invoked (see below). In case of login failure user remains on the same page.

### [logout](https://github.com/FaqZul/CodeIgniter-FauthZ-Library/blob/0.1.0/controllers/Fauth.php#L66)

[](#logout)

Logout user.

### [send\_again](https://github.com/FaqZul/CodeIgniter-FauthZ-Library/blob/0.1.0/controllers/Fauth.php#L117)

[](#send_again)

Send activation email again, to the same or new email address. This method is invoked every time after non-activated user logins on the site. It may be useful when user didn't receive activation mail sent on registration due to problem with mailbox or misprint in email address. User may change their email or leave it as is.

### [activate](https://github.com/FaqZul/CodeIgniter-FauthZ-Library/blob/0.1.0/controllers/Fauth.php#L140)

[](#activate)

Activate user account. Normally this method is invoked by clicking a link in activation email. Clicking a link in **[forgot password](#forgot_password)** email activates account as well. User is verified by User ID and authentication code in the URL.

### [forgot\_password](https://github.com/FaqZul/CodeIgniter-FauthZ-Library/blob/0.1.0/controllers/Fauth.php#L147)

[](#forgot_password)

Generate special reset code (to change password) and sent it to user. Obviously this method may be used when user has forgotten their password.

### [reset\_password](https://github.com/FaqZul/CodeIgniter-FauthZ-Library/blob/0.1.0/controllers/Fauth.php#L171)

[](#reset_password)

Replace user password (forgotten) with a new one (set by user). Then method can be called by clicking on link in mail. User is verified by User ID and authentication code in the URL.

### [change\_password](https://github.com/FaqZul/CodeIgniter-FauthZ-Library/blob/0.1.0/controllers/Fauth.php#L193)

[](#change_password)

"Normal" password changing (as compared with resetting forgotten password). Can be called only when user is logged in and activated. For higher security user's old password is needed.

### [change\_email](https://github.com/FaqZul/CodeIgniter-FauthZ-Library/blob/0.1.0/controllers/Fauth.php#L212)

[](#change_email)

Change user's email. Can be called only when user is logged in and activated. For higher security user's password is required. The new email won't be applied until it is activated by clicking a link in a mail sent to this email address.

### [reset\_email](https://github.com/FaqZul/CodeIgniter-FauthZ-Library/blob/0.1.0/controllers/Fauth.php#L235)

[](#reset_email)

Activate new email address and replace user's email with a new one. This method can be called by clicking a link in a mail. User is verified by User ID and authentication code in the URL.

### [unregister](https://github.com/FaqZul/CodeIgniter-FauthZ-Library/blob/0.1.0/controllers/Fauth.php#L242)

[](#unregister)

Delete user account. Can be called only when user is logged in and activated. For higher security user's password is required.

Versioning
----------

[](#versioning)

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/FaqZul/CodeIgniter-FauthZ-Library/tags).

Authors
-------

[](#authors)

- **Muhammad Faqih Zulfikar** - *Developer*

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](https://github.com/FaqZul/CodeIgniter-FauthZ-Library/blob/0.1.0/LICENSE) file for details.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

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

2177d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/32939170?v=4)[FaqZul](/maintainers/FaqZul)[@FaqZul](https://github.com/FaqZul)

---

Tags

authcodeigniterfaqzulfauthz

### Embed Badge

![Health badge](/badges/faqzul-codeigniter-fauthz-library/health.svg)

```
[![Health](https://phpackages.com/badges/faqzul-codeigniter-fauthz-library/health.svg)](https://phpackages.com/packages/faqzul-codeigniter-fauthz-library)
```

###  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)[lab404/laravel-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

2.3k16.4M48](/packages/lab404-laravel-impersonate)[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)

PHPackages © 2026

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