Clone from https://github.com/guigzz/silex-wsse. Added silex 2 support, corrected config sample with namespace.
This library provides an implementation of WSSE authentication based on the Symfony2 documentation.
"require": {
"klickagent/silex-wsse": "~0.1.0"
}
- Register the Klickagent\Wsse\WsseAuthServiceProvider
- Pass you own User provider to the Wsse provider
- Use it in your security firewall config
- You are done!
A basic config example would look like this:
$app->register(new Klickagent\SilexWsse\WsseAuthServiceProvider(), array(
'wsse.security_dir' => __DIR__ . '/../cache/security',
'wsse.valid_time_window' => 300,
'wsse.user' => function ($app) { return $app['dao.user']; }
));
And use it in your security firewall like this:
$app['security.firewalls'] = array(
'api' => array(
'pattern' => '^/api/',
'stateless' => true,
'wsse' => true,
)
);
- 'wsse.security_dir' (optional): where to store auth cache infos (default to your-app-root-dir/cache/security)
- 'wsse.valid_time_window' (optional): time in seconds of a WSSE validation window (default to 300s). For more infos, please read the Symfony2 documentation about Wsse.
- 'wsse.user' (mandatory): your app's user provider, so as to authenticate incoming requests.
This project is under the MIT License.