PHPackages                             deployed/myth-to-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. deployed/myth-to-shield

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

deployed/myth-to-shield
=======================

Tool to migrate from MythAuth to CodeIgniter Shield

v1.0.1(1y ago)1141MITPHPPHP ^7.4.3 || ^8.0

Since Nov 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/deployed-systems/mythToShield)[ Packagist](https://packagist.org/packages/deployed/myth-to-shield)[ Docs](https://github.com/deployed-systems/mythToShield)[ RSS](/packages/deployed-myth-to-shield/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (9)Versions (3)Used By (0)

CodeIgniter MythToShield
========================

[](#codeigniter-mythtoshield)

MythToShield is tool to migrate from MythAuth to CodeIgniter Shield. The main purpose of this library is to migrate the database to the Shield structure and keep the existing user data. t's up to developer to ensure that project code works properly with the Shield library.

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

[](#getting-started)

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

[](#prerequisites)

Usage of MythToShield requires the following:

- A [CodeIgniter 4.3.5+](https://github.com/codeigniter4/CodeIgniter4/) based project
- [Shield 1.0.1+](https://github.com/codeigniter4/shield/) library
- Converting tested from [MythAuth 1.2.1](https://github.com/lonnieezell/myth-auth/) but should work on older versions as well
- [Composer](https://getcomposer.org/) for package management
- PHP 7.4.3+

Installation
------------

[](#installation)

### Backup you database

[](#backup-you-database)

Always create a backup of your database first in case anything goes wrong during the migration process.

### Remove MythAuth Library

[](#remove-mythauth-library)

```
composer remove myth/auth
```

Remove the Myth auth from Autoload config. Also make sure to remove the MythAuth Config files if you have any in the APP\_NAMESPACE or anywhere else in the project since it will conflict with the Shield library

### Install Shield library

[](#install-shield-library)

```
composer require codeigniter4/shield
```

Add the Shield library to $psr4 namespaces in Autoload Config

```
public $psr4 = [
    APP_NAMESPACE => APPPATH,
    //...
    'CodeIgniter\Shield' => ROOTPATH . 'vendor/codeigniter4/shield/src'
]
```

### Install Settings library

[](#install-settings-library)

Shield should automatically pull settings library but this might change in future to be sure install the settings library directly into the project

```
composer require codeigniter4/settings
```

Add the Settings library to $psr4 namespaces in Autoload Config

```
public $psr4 = [
    APP_NAMESPACE => APPPATH,
    //...
    'CodeIgniter\Settings' => ROOTPATH . 'vendor/codeigniter4/settings/src'
]
```

### Install MythToShield library

[](#install-mythtoshield-library)

```
composer require deployed/myth-to-shield
```

Add the MythToShield library to $psr4 namespaces in Autoload Config

```
public $psr4 = [
    APP_NAMESPACE => APPPATH,
    //...
    'Deployed\MythToShield' => ROOTPATH . 'vendor/deployed/myth-to-shield/src'
]
```

### Configure Shield

[](#configure-shield)

Manually create shield config file or registrar if you want to override default table names from shield. `php spark shield:setup` and shield migrations should not be executed. The MythToShield migrator will create the tables. The settings library migrations can be executed, but it is not required since the MythToShield migrator will take care of those as well.

### Additional Commands - This step is optional

[](#additional-commands---this-step-is-optional)

MythToShield library provides MythToShield config class which can be used to execute additional commands. See the [config file](src/Config/MythToShield.php) for more information

### 6. Run the migration command.

[](#6-run-the-migration-command)

```
php spark mythToShield:migrate

```

It should return `MythToShield migration completed successfully` message

Compatibility Mode
------------------

[](#compatibility-mode)

Myth Auth uses different method to store and verify the password hashes. In order for Shield to work with existing password additional column named `myth_hash` is added to the identities table. The initial value in this column is set to `1` for every user account.

To process the Myth Auth hashes [MythCompatSession](src/Authenticators/MythCompatSession.php) authenticator class is loaded to replace the shield session authenticator via registrar. When user tries to logg in for the first time via shield myth\_hash value is checked if it contains `1` the user password is verified using the Myth Auth method. On first successful login new password hash is generated and `0` is set as the myth\_hash value. When myth\_hash is 0 MythCompatSession authenticator uses the more secure Shield hashing method and does not allow users to log in with Myth Auth password hashes.

Uninstalling the library
------------------------

[](#uninstalling-the-library)

MythToShield library should be kept installed as long as Myth Auth password hash compatibility is needed. When the compatibility is not needed anymore the myth\_hash column should be removed from the identities table first.

There is a command for removing the database column

```
php spark   mythToShield:cleanup
```

Once the database is cleaned the MythToShield library can also be deleted.

Remove the library from the Autoload Config

```
'Deployed\MythToShield' => ROOTPATH . 'vendor/deployed/myth-to-shield/src'

```

Remove the composer package

```
composer remove deployed/myth-to-shield
```

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

[](#contributing)

MythToShield does accept and encourage contributions from the community in any shape. It doesn't matter whether you can code, write documentation, or help find bugs, all contributions are welcome. See the [CONTRIBUTING.md](CONTRIBUTING.md) file for details.

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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 ~6 days

Total

2

Last Release

526d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

Authenticationcodeigniterauthorizationcodeigniter4shieldmythmyth-auth

###  Code Quality

TestsPHPUnit

Static AnalysisRector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/deployed-myth-to-shield/health.svg)

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

###  Alternatives

[codeigniter4/shield

Authentication and Authorization for CodeIgniter 4

417372.4k22](/packages/codeigniter4-shield)[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)[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)
