8000 [Profiler] Exit impersonation links by rvanlaak · Pull Request #17037 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Profiler] Exit impersonation links #17037

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 1 commit into from
Closed
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
[Profiler] Exit impersonation links
  • Loading branch information
rvanlaak committed Dec 16, 2015
commit 3d75f488a7bbaf85e03242a813fd1c05e3010b37
8000
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@
<div class="sf-toolbar-info-piece">
<b>Actions</b>
<span><a href="{{ collector.logoutUrl }}">Logout</a></span>
{% if 'ROLE_PREVIOUS_ADMIN' in collector.roles %}
- <span>
<a href="{{ path(profile.getcollector('request').requestattributes.get('_route'), {'_switch_user': '_exit'}) }}">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beware that the _switch_user query param is configurable for security reasons. See http://symfony.com/doc/current/cookbook/security/impersonating_user.html

impersonate

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're completely right (as usual), so I've been trying to retrieve these parameters but it seems I can't get any further than the firewall key.

$this->tokenStorage->getToken()->getProviderKey()

Seems that problem already was mentioned in http://stackoverflow.com/questions/19610316/how-to-access-firewall-configuration-in-controller

So, how can we "unlock" these configuration parameters for the SecurityDataCollector?

Exit impersonation
</a>
</span>
{% endif %}
</div>
{% endif %}
{% elseif collector.enabled %}
Expand Down Expand Up @@ -110,6 +117,21 @@
{% endif %}
</tbody>
</table>

{% if collector.logoutUrl %}
<div>
<b>Actions:</b>
<span><a href="{{ collector.logoutUrl }}">Logout</a></span>
{% if 'ROLE_PREVIOUS_ADMIN' in collector.roles %}
- <span>
<a href="{{ path(profile.getcollector('request').requestattributes.get('_route'), {'_switch_user': '_exit'}) }}">
Exit impersonation
</a>
</span>
{% endif %}
</div>
{% endif %}

{% elseif collector.enabled %}
<div class="empty">
<p>There is no security token.</p>
Expand Down
0