This repository contains a PHP legacy application with home rolled authentication. It's not very secure, any account with a password of 'password' is logged in.
Read the corresponding blog posts:
- https://fusionauth.io/blog/updating-crufty-php-application
- https://fusionauth.io/blog/how-to-migrate-user-data-centralized-auth-system
- A modern PHP
- Docker for running FusionAuth
- This repo
Note that Connectors are a feature available to FusionAuth installations with a paid edition. You can sign up for a 14 day free trial of the "Starter" Edition to test this functionality out.
- Clone this repo and
cdinto it. - Update
kickstart/kickstart.json. Replace the textADD LICENSE IDwith a valid FusionAuth license Id retrieved previously.- If you don't have a license Id, this example will not work.
- Run
docker compose up -dto stand up a preconfigured FusionAuth instance. - Run
composer install. - Start a webserver:
php -S 0.0.0.0:8000. This should not be used for production.
- Go to
http://localhost:8000and login. - An email address with a password of
passwordwill be logged in using the connector. - Users will who successfully authenticate will be migrated from the legacy application to FusionAuth.
- If you reset a FusionAuth user's password (using the administrative user interface) to
password2, that's what you'll have to use to login.
To access the admin UI to see if users are migrated or to examine the connector configuration, open an incongito browser window and visit http://localhost:9011. The username is admin@example.com and the password is, you guessed it, password.
- Kill the webserver process.
docker compose down -vwill delete the FusionAuth server.