helthe/api-security-bundle

Helthe API Security bundle for Symfony 2

1.0.0 2014-02-21 07:08 UTC

This package is auto-updated.

Last update: 2024-10-29 04:14:36 UTC


README

Helthe Api Security Bundle integrates the Helthe API Security Component with your Symfony2 application.

Installation

Step 1: Add package requirement in Composer

Manually

Add the following in your composer.json:

{
    "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.

Firewall

To add api key authentication, simply add the api_key in your firewall configuration as shown below:

# security.yml
security:
    firewalls:
        api:
            api_key:
                name:   helthe-api-key
                method: http_header

Bugs

For bugs or feature requests, please create an issue.