API Key based Authentication bundle for Symfony2
This bundle will enable the new api_key authentication provider
use it as below in your security.yml file
security:
firewall:
your-firewall-name:
pattern: ^/what-you-wish-to-protect/
provider: user_provider_name
api_key:
parameter: apikey
stateless: true
The new user provider should provide api keys as username
The loadUserFromUsername()
method will be called with the supplied api key the Authentication class does not care about the credentials fields
$ composer require bburnichon/bbn-security-bundle:@dev
Then add the following to your AppKernel
$bundles = array(
new BBn\SecurityBundle\BBnSecurityBundle(),
);
$ php bin/phpunit
bbn-security-bundle is released under the MIT License. See the bundled LICENSE file for details.