mheap/silex-security

This package is abandoned and no longer maintained. No replacement package was suggested.

Wrapper around symfony\security to reduce config needed

0.0.1 2014-02-16 16:03 UTC

This package is auto-updated.

Last update: 2020-11-26 18:33:58 UTC


README

require 'vendor/autoload.php';

$app = new Silex\Application();

$app['mheap.security.open_routes'] = array(
    "index" => "^/$"
);

$app['mheap.security.pages'] = array(
    "login" => "/login",
    "logout" => "/logout",
    "login_redirects_to" => "/"
);

$app['mheap.security.user_provider'] = $app->share(function() use ($app) {
    return new mheap\UserProvider;
});

$app->register(new mheap\SecurityServiceProvider());

$app->get('/login', function () use ($app) {
    return "FOO";
});