P
P
Peter2013-11-27 13:20:20
PHP
Peter, 2013-11-27 13:20:20

Silex and SecurityServiceProvider: Job firewalls

Hi again.
Faced SecurityServiceProvider in Silex. At the first step, a question arose, the answer to which was not possible to google.
To connect the SecurityServiceProvider, you need to place the following code:

$app->register(new Silex\Provider\SecurityServiceProvider(), array(
    'security.firewalls' => // see below
));

(source: http://silex.sensiolabs.org/doc/providers/security.html )
However, I don't understand which firewall to specify in the array? see below takes us to the Defining a custom Authentication Provider section . In particular, it mentions " form, HTTP, X509, remember me, ... , but there is no word about which one and why you need to choose, how to register them, etc.
I would appreciate a useful link or a short explanation.
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Peter, 2013-11-27
@Alcospb

C battle figured out that the correct form is as follows:

$app->register(new Silex\Provider\SecurityServiceProvider());
$app['security.firewalls'] = array(
    'admin' => array(
        'pattern' => '^/admin',
        'http' => true,
        'users' => array(
            'admin' => array(admin),
        ),
    ),
);

However, that doesn't make it any less of a problem :)

P
Peter, 2013-11-27
@Alcospb

I took an example from the documentation:

$app->register(new Silex\Provider\SecurityServiceProvider(), array(
    'security.firewalls' => array(
        'default' => array(
            'wsse' => true,
        ),
    ),
));

Got a fatal error.
Obviously there is something I don't understand.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question