Experimental project to learn symfony + jwt
docker network create symf-network
docker build -t symf/symf-app .docker/app
cd application
cp .env.example .env
From inside docker container:
composer install
export XDEBUG_SESSION=PHPSTORM
export PHP_IDE_CONFIG="serverName=symf.dv"
Value "symf.dv" writen to .docker/web/nginx/conf.d/default.conf and inside docker-compose.yml at PHP_IDE_CONFIG: 'serverName=symf.dv'
From the inside of the symf-app container:
bin/console lexik:jwt:generate-keypair
url: http://localhost:8000/api/login_check body: {"username":"johndoe","password":"test"}
In your post headers:
Authorization: Bearer {token}
INSERT INTO symf.users (id, username, password, name) VALUES (1, 'jonas', '$2y$13$v5olE3gyeaKGkBhYlDtuw.hO4WwazOiN5l.u/N1UbM13HuBDEiZ6i', 'Jonas');
This will create user with username 'jonas' and password 'test'
To generate other password, call
bin/console security:hash-password
calculate code lines
find . -name '*.php' | xargs wc -l