Project Bootstrap for an Angular 2+ and Symfony 4+ webservices project.
This project is a template application with a secured RestFul API communication via WSS UserToken security scheme.
I'm working on this project in my free time and offering it free of charges. To help me work more on this you can send me tips to buy more coffee :)
Install docker and docker-compose.
Clone the project :
git clone [email protected]:FlyersWeb/angular-symfony.git
Launch dockerized environment :
docker-compose up -d
Log in application docker image :
docker-compose exec application bash
Install dependencies :
composer install
Update schemas (FOSUserBundle) :
php bin/console doctrine:schema:create
Create and activate user :
php bin/console doctrine:fixtures:load
Access the front end using port 4200 :
firefox http://localhost:4200 &
The Authentication system is based on the custom Authentication Provider of the Symfony Cookbook
The following chapter demonstrates how to create a custom authentication provider for WSSE authentication. The security protocol for WSSE provides several security benefits:
- Username / Password encryption
- Safe guarding against replay attacks
- No web server configuration required
WSSE is very useful for the securing of web services, may they be SOAP or REST.
I used the exact same authentication system.
On the client side, I've inspired my code from Angular official documentation about HttpInterceptor, allowing me to send the WSS UserToken on each HTTP request when token is available. Examples usually shows how to send the Authorization header.
The difference there is that I send the token, username and user digest in the HTTP Header X-WSSE.
This program is free software. It comes without any warranty, to the extent permitted by applicable law.
This software is LICENSED under the MIT License. Use it at your own risk.
Servers are configured for developments purposes. Do not deploy this project on production as is. You should have a look to Symfony deployment documentation for the Back-end and the Angular deployment documentation for the Front-End part.
You can use this template and adapt it to your needs.
@FlyersWeb