Skip to content

Fixes security authentication provider cookbook article #1050

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Removes deprecated 'security_factories' directive in the cookbook art…
…icle in favor of adding the extension in the Bundle.
  • Loading branch information
bshaffer committed Jan 31, 2012
commit f62b6466efdeb25d2b6838726f93fbfa7f7fe8ce
40 changes: 16 additions & 24 deletions cookbook/security/custom_authentication_provider.rst
Original file line number Diff line number Diff line change
Expand Up @@ -427,35 +427,27 @@ factory service, tagged as ``security.listener.factory``:
</services>
</container>

Now, import the factory configuration via the the ``factories`` key in your
security configuration:
As a final step, add the factory to the security extension in your bundle class.

.. configuration-block::

.. code-block:: yaml

# app/config/security.yml
security:
factories:
- "%kernel.root_dir%/../src/Acme/DemoBundle/Resources/config/security_factories.yml"
.. code-block:: php

.. code-block:: xml
// src/Acme/DemoBundle/AcmeDemoBundle.php
namespace Acme\DemoBundle;

<!-- app/config/security.xml -->
<config>
<factories>
"%kernel.root_dir%/../src/Acme/DemoBundle/Resources/config/security_factories.xml
</factories>
</config>
use Acme\DemoBundle\DependencyInjection\Security\Factory\WsseFactory;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;

.. code-block:: php
class AcmeDemoBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
parent::build($container);

// app/config/security.php
$container->loadFromExtension('security', array(
'factories' => array(
"%kernel.root_dir%/../src/Acme/DemoBundle/Resources/config/security_factories.php"
),
));
$extension = $container->getExtension('security');
$extension->addSecurityListenerFactory(new WsseFactory());
}
}

You are finished! You can now define parts of your app as under WSSE protection.

Expand Down