Run the following in your project root, assuming you have composer set up for your project
composer require happyr/api-bundle
Add the bundle to app/AppKernel.php
$bundles = [
// ...
new Happyr\ApiBundle\HappyrApiBundle(),
];
Wsse is built in and can be enabled - disabled by default.
To enable and configure it, in config.yml add
happyr_api:
wsse:
user_provider: "@security.user.provider.in_memory.user" # The @-sign is needed
cache_service: "cache.provider.redis"
lifetime: 300
debug: false # Set to true to disable WSSE completely. You will always be authenticated.
And in security.yml configure your provider where you store users to something like this
security:
providers:
in_memory:
memory:
users:
username:
password: password
roles: ['ROLE_API_USER']
And under firewalls in security.yml, add a new firewall like so
security:
firewalls:
main:
pattern: ^/api/
stateless: true
wsse: true