Skip to content
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

Caution about impersonation not compatible with pre authenticated #6673

Merged
merged 2 commits into from
Jul 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 11 additions & 2 deletions cookbook/security/impersonating_user.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,17 @@ How to Impersonate a User

Sometimes, it's useful to be able to switch from one user to another without
having to log out and log in again (for instance when you are debugging or trying
to understand a bug a user sees that you can't reproduce). This can be easily
done by activating the ``switch_user`` firewall listener:
to understand a bug a user sees that you can't reproduce).

.. caution::

User impersonation is not compatible with
:doc:`pre Authenticated firewalls</cookbook/security/pre_authenticated>`. The
reason is that impersonation requires the authentication state to be maintained
server-side but pre-authenticated information (``SSL_CLIENT_S_DN_Email``,
``REMOTE_USER`` or other) is sent in each request.

This can be easily done by activating the ``switch_user`` firewall listener:

.. configuration-block::

Expand Down
14 changes: 8 additions & 6 deletions cookbook/security/pre_authenticated.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ box, Symfony supports most authentication mechanisms.
These requests are called *pre authenticated* requests because the user is already
authenticated when reaching your application.

.. caution::

:doc:`User impersonation </cookbook/security/impersonating_user>` is not
compatible with pre-authenticated firewalls. The reason is that
impersonation requires the authentication state to be maintained server-side
but pre-authenticated information (``SSL_CLIENT_S_DN_Email``, ``REMOTE_USER``
or other) is sent in each request.

X.509 Client Certificate Authentication
---------------------------------------

Expand Down Expand Up @@ -152,9 +160,3 @@ key in the ``remote_user`` firewall configuration.
See :ref:`the previous note <cookbook-security-pre-authenticated-user-provider-note>`
for more information.

.. caution::

:doc:`User impersonation </cookbook/security/impersonating_user>` is not
compatible with ``REMOTE_USER`` based authentication. The reason is that
impersonation requires the authentication state to be maintained server-side
but ``REMOTE_USER`` information is sent by the browser in each request.