ibrows/hmac-bundle

Symfony HMAC Bundle adds a SecurityListenerFactor which provide a hmac authentication for configured firewall

Installs: 1 410

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:symfony-bundle

1.0.0 2015-08-27 15:04 UTC

This package is auto-updated.

Last update: 2024-11-15 19:39:56 UTC


README

Build Status

Ibrows HMAC Bundle adds a SecurityListenerFactor which provide a hmac authentication for configured firewall This is a recommend way to sign and verify RESTful Web API requests

Install & setup the bundle

  1. Add IbrowsHmacBundle in your composer.json:

    {
        "require": {
            "ibrows/hmac-bundle": "~1.0",
        }
    }
  2. Now tell composer to download the bundle by running the command:

    $ php composer.phar update ibrows/hmac-bundle
  3. Add the bundle to your AppKernel class

    // app/AppKernerl.php
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new \Ibrows\HmacBundle\IbrowsHmacBundle(),
            // ...
        );
        // ...
    }
  4. Sample Configuration of your security.yml

    security:
        firewalls:
            api:
                pattern:  ^/api
                stateless: true
                anonymous: ~
                provider: api_provider
                ibrows_hmac:
                    authentication_provider_key: me
        access_control:
            - { path: ^/api/, roles: ROLE_API }
        encoders:
            Symfony\Component\Security\Core\User\User: plaintext
        providers:
            api_provider:
                memory:
                    users:
                        test:
                            password: test
                            roles:  ['ROLE_API']