Download the PHP package deployed/myth-to-shield without Composer
On this page you can find all versions of the php package deployed/myth-to-shield. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download deployed/myth-to-shield
More information about deployed/myth-to-shield
Files in deployed/myth-to-shield
Package myth-to-shield
Short Description Tool to migrate from MythAuth to CodeIgniter Shield
License MIT
Homepage https://github.com/deployed-systems/mythToShield
Informations about the package myth-to-shield
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
Prerequisites
Usage of MythToShield requires the following:
- A CodeIgniter 4.3.5+ based project
- Shield 1.0.1+ library
- Converting tested from MythAuth 1.2.1 but should work on older versions as well
- Composer for package management
- PHP 7.4.3+
Installation
Backup you database
Always create a backup of your database first in case anything goes wrong during the migration process.
Remove MythAuth Library
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
Add the Shield library to $psr4 namespaces in Autoload Config
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
Add the Settings library to $psr4 namespaces in Autoload Config
Install MythToShield library
Add the MythToShield library to $psr4 namespaces in Autoload Config
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
MythToShield library provides MythToShield config class which can be used to execute additional commands. See the config file for more information
6. Run the migration command.
It should return MythToShield migration completed successfully
message
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 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
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
Once the database is cleaned the MythToShield library can also be deleted.
Remove the library from the Autoload Config
Remove the composer package
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 file for details.
License
This project is licensed under the MIT License - see the LICENSE file for details.
All versions of myth-to-shield with dependencies
codeigniter4/settings Version ^2.1
codeigniter4/shield Version >=1.0.1