A Symfony 4 based RESTful API which is secured with JWT authentication without FOSRestBundle, Nelmio and Swagger.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
PHP >=7.0
$ composer install
$ mkdir config/jwt
$ openssl genrsa -out config/jwt/private.pem -aes256 4096
$ openssl rsa -pubout -in config/jwt/private.pem -out config/jwt/public.pem
In case first openssl
command forces you to input password use following to get the private key decrypted
$ openssl rsa -in config/jwt/private.pem -out config/jwt/private2.pem
$ mv config/jwt/private.pem config/jwt/private.pem-back
$ mv config/jwt/private2.pem config/jwt/private.pem
- Update JWT_PASSPHRASE in .env file
$ php bin/console doctrine:database:create
$ php bin/console doctrine:schema:create
$ php bin/console doctrine:fixtures:load
$ php bin/console server:start
$ php bin/phpunit
- Find an alternative to LexikBundle
- Use a specific SQLite database for tests
- Christopher Arzur - Initial work