Add a new repository to your composer.json
"repositories": [
{
"type": "vcs",
"url": "https://github.com/stadline/WSSESecurityBundle.git"
}
]
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require stadline/wsse-security-bundle dev-master
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Then, enable the bundle by adding the following line in the app/AppKernel.php
file of your project:
<?php
// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new Stadline\WSSESecurityBundle\StadlineWSSESecurityBundle(),
);
// ...
}
// ...
}
stadline_wsse_security: ~
app/console doctrine:migrations:diff
app/console doctrine:migrations:migrate
providers:
api_partner:
id: api.partner.user.provider
firewalls:
api:
pattern: ^/api
anonymous: true
wsse: true
provider: api_partner
Start by creating a new Partner
app/console console wsse:partner:create api-test api-test ROLE_API
Test your API with real X-WSSE Header
app/console console wsse:wsse-generator api-test
> UsernameToken Username="api-test", PasswordDigest="MgLLsYsJ3hg/p/dnXCm1H8DkJNA=", Nonce="unjRzavW6hCCTv5zI/YXWA==", Created="2015-05-29T15:46:15Z"