Helthe Api Security Bundle integrates the Helthe API Security Component
with your Symfony2 application., (*1)
Installation
Step 1: Add package requirement in Composer
Manually
Add the following in your composer.json
:, (*2)
{
"require": {
// ...
"helthe/api-security-bundle": "~1.0"
}
}
Using the command line
$ composer require 'helthe/api-security-bundle=~1.0'
Step 2: Register the bundle in the kernel
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Helthe\Bundle\ApiSecurityBundle\HeltheApiSecurityBundle(),
);
}
Usage
User Provider
The Helthe API security component provides its own UserProviderInterface
that
must implemented by the user provider supplied to the Symfony firewall using
api key authentication., (*3)
Firewall
To add api key authentication, simply add the api_key
in your firewall
configuration as shown below:, (*4)
# security.yml
security:
firewalls:
api:
api_key:
name: helthe-api-key
method: http_header
Bugs
For bugs or feature requests, please create an issue., (*5)