2017 © Pedro Peláez
 

library signed-auth-bundle

Signed auth bundle

image

epustobaev/signed-auth-bundle

Signed auth bundle

  • Tuesday, May 24, 2016
  • by epustobaev
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

SignedAuthBundle

SensioLabsInsight, (*1)

About

The SignedAuthBundle allows you to use token with hashed request parameters and secret key for authentication in your Symfony 2 project., (*2)

Features

  • Token can be provided with header or GET|POST parameter
  • Configurable hash params: secret key getter, hash string concatenation delimiter, token delimiter, token key name
  • Ability to sign params from request(uri, host, etc), headers and query(POST and GET)

Installation

Require the epustobaev/signed-auth-bundle package in your composer.json and update your dependencies., (*3)

$ composer require epustobaev/signed-auth-bundle

Add the SignedAuthBundle to your application's kernel:, (*4)

public function registerBundles()
{
    $bundles = array(
        ...
        new Dendy\SignedAuthBundle\DendySignedAuthBundle(),
        ...
    );
    ...
}

Configuration

Example uses orm user provider, token in request header "x-auth", sign params from headers, query and request, hash algorithm md5 and default delimiters. Example token value: username:ec1cef72d94b43cc96fc8a866f6e19d3., (*5)

security:
    providers:
        some_provider:
            entity:
                class: Namespace\Bundle\SomeBundle\Entity\SomeUser
                property: name
                manager_name: default
    firewalls:
        ## some other
        signed_secured:
            pattern:   ^/api/
            stateless: true
            provider: some_provider
            signed:
                auth_type: header
                request_key: x-auth
                token_delimiter: ':'
                data_delimiter: '|'
                hash_alg: 'md5'
                secret_getter: 'getAuthSecret'
                signed_params:
                    headers: ['Host', 'User-Agent']
                    query: ['username']
                    request: ['requestUri']

auth_type - default value is 'request' - get token value from GET or POST, in opposite 'headers' means that the token is provided in request headers., (*6)

request_key - default value is 'sign', otherwise can be any string value., (*7)

token_delimiter - default value is ':', otherwise can be any string value., (*8)

data_delimiter - default value is ':', otherwise can be any string value., (*9)

hash_alg - default value is 'md5', see accepted values http://php.net/manual/ru/function.hash-algos.php, (*10)

secret_getter - method of user object to get secret key., (*11)

signed_params - signed values configuration, getting data from Symfony\Component\HttpFoundation\Request instance., (*12)

signed_params[headers] - array of request headers to sign($request->headers->get('Host'))., (*13)

signed_params[query] - array of request query params($request->get('Host')), (*14)

signed_params[request] - array of request query params($request->getRequestUri()), (*15)

The Versions

24/05 2016

dev-master

9999999-dev https://github.com/epustobaev

Signed auth bundle

  Sources   Download

MIT

The Requires

 

api authentication rest symfony2 hash sign

15/08 2015

dev-develop

dev-develop https://github.com/epustobaev

Signed auth bundle

  Sources   Download

MIT

The Requires

 

api authentication rest symfony2 hash sign

15/08 2015

1.0.1

1.0.1.0 https://github.com/epustobaev

Signed auth bundle

  Sources   Download

MIT

The Requires

 

api authentication rest symfony2 hash sign

14/08 2015

1.0

1.0.0.0 https://github.com/epustobaev

Signed auth bundle

  Sources   Download

MIT

The Requires