PHPackages                             ruhafzazahedi/shield - 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. ruhafzazahedi/shield

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

ruhafzazahedi/shield
====================

Auth for CodeIgniter 4

v1.0.2(1y ago)028MITPHPPHP ^7.4.3 || ^8.0

Since Jun 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ruhafzazahedi/shield)[ Packagist](https://packagist.org/packages/ruhafzazahedi/shield)[ RSS](/packages/ruhafzazahedi-shield/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (10)Versions (4)Used By (0)

CI Shield
=========

[](#ci-shield)

Shield is the official authentication and authorization framework for CodeIgniter 4. While it does provide a base set of tools that are commonly used in websites, it is designed to be flexible and easily customizable.

The primary goals for Shield are:

1. It must be very flexible and allow developers to extend/override almost any part of it.
2. It must have security at its core. It is an auth lib after all.
3. To cover many auth needs right out of the box, but be simple to add additional functionality to.

Authentication Methods
----------------------

[](#authentication-methods)

Shield provides two primary methods **Session-based** and **Access Token**authentication out of the box.

It also provides **HMAC SHA256 Token** and **JSON Web Token** authentication.

### Session-based

[](#session-based)

This is your typical phone/username/password system you see everywhere. It includes a secure "remember-me" functionality. This can be used for standard web applications, as well as for single page applications. Includes full controllers and basic views for all standard functionality, like registration, login, forgot password, etc.

### Access Token

[](#access-token)

These are much like the access tokens that GitHub uses, where they are unique to a single user, and a single user can have more than one. This can be used for API authentication of third-party users, and even for allowing access for a mobile application that you build.

### HMAC SHA256 Token

[](#hmac-sha256-token)

This is a slightly more complicated improvement on Access Token authentication. The main advantage with HMAC is the shared Secret Key is not passed in the request, but is instead used to create a hash signature of the request body.

### JSON Web Token

[](#json-web-token)

JWT or JSON Web Token is a compact and self-contained way of securely transmitting information between parties as a JSON object. It is commonly used for authentication and authorization purposes in web applications.

Important Features
------------------

[](#important-features)

- Session-based authentication (traditional ID/Password with Remember-me)
- Stateless authentication using Personal Access Tokens
- Optional Phone verification on account registration
- Optional SMS-based Two-Factor Authentication after login
- Magic Link Login when a user forgets their password
- Flexible Groups-based access control (think Roles, but more flexible)
- Users can be granted additional Permissions

See the [An Official Auth Library](https://forum.codeigniter.com/showthread.php?tid=82003) for more Info.

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

[](#getting-started)

### Prerequisites

[](#prerequisites)

Usage of Shield requires the following:

- A [CodeIgniter 4.3.5+](https://github.com/codeigniter4/CodeIgniter4/) based project
- [Composer](https://getcomposer.org/) for package management
- PHP 7.4.3+

### Installation

[](#installation)

Installation is done through Composer.

```
composer require ruhafzazahedi/shield
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

Every ~0 days

Total

3

Last Release

693d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/35bb6910b486f2e44ab15123d2d47b4b465f850123b7aa3c4307b43e0ac0eb7e?d=identicon)[ruhafzazahedi](/maintainers/ruhafzazahedi)

---

Top Contributors

[![ruhafzazahedi](https://avatars.githubusercontent.com/u/74387147?v=4)](https://github.com/ruhafzazahedi "ruhafzazahedi (7 commits)")

---

Tags

Authenticationcodeigniterauthorizationcodeigniter4

###  Code Quality

TestsPHPUnit

Static AnalysisRector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ruhafzazahedi-shield/health.svg)

```
[![Health](https://phpackages.com/badges/ruhafzazahedi-shield/health.svg)](https://phpackages.com/packages/ruhafzazahedi-shield)
```

###  Alternatives

[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)[league/oauth2-client

OAuth 2.0 Client Library

3.8k118.6M1.2k](/packages/league-oauth2-client)[codeigniter4/shield

Authentication and Authorization for CodeIgniter 4

417372.4k22](/packages/codeigniter4-shield)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[auth0/auth0-php

PHP SDK for Auth0 Authentication and Management APIs.

40820.2M68](/packages/auth0-auth0-php)

PHPackages © 2026

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