Skip to content

Commit 715ff86

Browse files
committed
minor #14140 Add documentation about impersonating users with an HTTP Header (srogier)
This PR was submitted for the 3.4 branch but it was merged into the 4.4 branch instead. Discussion ---------- Add documentation about impersonating users with an HTTP Header Commits ------- 399ed2b Add documentation about impersonating users with an HTTP Header
2 parents ba906a5 + 399ed2b commit 715ff86

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

security/impersonating_user.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ as the value to the current URL:
7272
7373
http://example.com/somewhere?_switch_user=thomas
7474
75+
.. tip::
76+
77+
Instead of adding a ``_switch_user`` query string parameter, you can pass
78+
the username in a ``HTTP_X_SWITCH_USER`` header.
79+
7580
To switch back to the original user, use the special ``_exit`` username:
7681

7782
.. code-block:: text
@@ -197,7 +202,7 @@ Limiting User Switching
197202

198203
If you need more control over user switching, you can use a security voter. First,
199204
configure ``switch_user`` to check for some new, custom attribute. This can be
200-
anything, but *cannot* start with ``ROLE_`` (to enforce that only your voter will
205+
anything, but *cannot* start with ``ROLE_`` (to enforce that only your voter will
201206
be called):
202207

203208
.. configuration-block::

0 commit comments

Comments
 (0)