Code Monkey home page Code Monkey logo

silex-wsse's Introduction

Clone from https://github.com/guigzz/silex-wsse. Added silex 2 support, corrected config sample with namespace.

Silex WSSE authentication

This library provides an implementation of WSSE authentication based on the Symfony2 documentation.

Installation

Composer

"require": {
	"klickagent/silex-wsse": "~0.1.0"
}

Usage

  • Register the Klickagent\Wsse\WsseAuthServiceProvider
  • Pass you own User provider to the Wsse provider
  • Use it in your security firewall config
  • You are done!

A basic config example would look like this:

$app->register(new Klickagent\SilexWsse\WsseAuthServiceProvider(), array(
    'wsse.security_dir'         => __DIR__ . '/../cache/security',
    'wsse.valid_time_window'    => 300,
    'wsse.user'                 => function ($app) { return $app['dao.user']; }
));

And use it in your security firewall like this:

$app['security.firewalls'] = array(
    'api'   => array(
        'pattern'   => '^/api/',
        'stateless' => true,
        'wsse'      => true,
    )
);

Configuration

  • 'wsse.security_dir' (optional): where to store auth cache infos (default to your-app-root-dir/cache/security)
  • 'wsse.valid_time_window' (optional): time in seconds of a WSSE validation window (default to 300s). For more infos, please read the Symfony2 documentation about Wsse.
  • 'wsse.user' (mandatory): your app's user provider, so as to authenticate incoming requests.

License

This project is under the MIT License.

silex-wsse's People

Contributors

guigzz avatar klickagent avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.