Skip to content

Commit

Permalink
Merge pull request #3309 from Danez/2.1
Browse files Browse the repository at this point in the history
Remove invalid tip for multiple providers
  • Loading branch information
weaverryan committed Dec 19, 2013
2 parents ed0f3fd + f5d2a66 commit 4d04fd1
Showing 1 changed file with 0 additions and 49 deletions.
49 changes: 0 additions & 49 deletions book/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1469,55 +1469,6 @@ Now, all authentication mechanisms will use the ``chain_provider``, since
it's the first specified. The ``chain_provider`` will, in turn, try to load
the user from both the ``in_memory`` and ``user_db`` providers.

.. tip::

If you have no reasons to separate your ``in_memory`` users from your
``user_db`` users, you can accomplish this even more easily by combining
the two sources into a single provider:

.. configuration-block::

.. code-block:: yaml
# app/config/security.yml
security:
providers:
main_provider:
memory:
users:
foo: { password: test }
entity:
class: Acme\UserBundle\Entity\User,
property: username
.. code-block:: xml
<!-- app/config/security.xml -->
<config>
<provider name=="main_provider">
<memory>
<user name="foo" password="test" />
</memory>
<entity class="Acme\UserBundle\Entity\User" property="username" />
</provider>
</config>
.. code-block:: php
// app/config/security.php
$container->loadFromExtension('security', array(
'providers' => array(
'main_provider' => array(
'memory' => array(
'users' => array(
'foo' => array('password' => 'test'),
),
),
'entity' => array('class' => 'Acme\UserBundle\Entity\User', 'property' => 'username'),
),
),
));
You can also configure the firewall or individual authentication mechanisms
to use a specific provider. Again, unless a provider is specified explicitly,
the first provider is always used:
Expand Down

0 comments on commit 4d04fd1

Please sign in to comment.