Skip to content

uitsmijter/example-todo-php-application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Demo ToDo app

This app demonstrates a simple ToDo page before and after migrating authentifiction to Uitsmijter.

Before the Uitsmijter integration, users can register and the authentication is done by reading and comparing entries from the database users table. This can be tested using the state from the db-backend branch.

After integrating Uitsmijter it handles the users (identified by their email address). When a user is not present in the ToDo app it will be added to the users table. This can be tested using the state from the uitsmijter-backend branch.

Installation

For JWT auth to work, php-open-source-saver/jwt-auth is used. The Uitsmijter Traefik middleware parses and validates the uitsmijter-sso cookie and sets an authorization: Bearer [token] header which is used to authenticate the user. For the exact setup steps see the Uitsmijter docs, jwt-auth documentation and the commits in this repository for the implementation.

The user creation is done by the JWTAuthProvider.php. Some debug information can be viewed by visiting /debug on the page.

For local testing, a valid JWT must be send as an Authorization: Bearer [token] header for every request.

docker run --rm -v "$PWD":/app -u $(id -u):$(id -g) composer install --ignore-platform-reqs
cp .env.dev .env
vendor/bin/sail build

Run the application

vendor/bin/sail up

and in another terminal to set up the env:

vendor/bin/sail npm install
vendor/bin/sail npm run build
vendor/bin/sail artisan migrate

The application is available at localhost.

Stop the application

vendor/bin/sail stop

or press Ctrl+C

About

Example monolith application

Resources

Stars

Watchers

Forks

Contributors

Languages