<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Impersonating friendly URLs</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=117332933" />
  <subtitle>Impersonating friendly URLs</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=117332933</id>
  <updated>2026-04-05T16:09:37Z</updated>
  <dc:date>2026-04-05T16:09:37Z</dc:date>
  <entry>
    <title>RE: Impersonating friendly URLs</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117341515" />
    <author>
      <name>Jan Tošovský</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117341515</id>
    <updated>2019-10-02T16:05:42Z</updated>
    <published>2019-10-02T16:05:42Z</published>
    <summary type="html">I fixed it. Originally this was fix for another issue, but both turned out to be related.&lt;br /&gt;My resourceAction should return PNG attachment, but the content was written directly to the page as characters. After further analysis I found this binary content is wrapped by senna container so I finally found the root cause.&lt;br /&gt;My links look like this: &amp;lt;a href=&amp;#34; .../attachment/2749384?doAsUserId=xRdO8Wv72X5YHWlYGO&amp;#34;&amp;gt;. However, they are internally processed by SennaJS, which, in my case, breaks the original functionality.&lt;br /&gt;So with the help of &lt;a href="https://stackoverflow.com/questions/41288039/how-can-i-disable-sennajs-spa-in-liferay-7"&gt;https://stackoverflow.com/questions/41288039/how-can-i-disable-sennajs-spa-in-liferay-7 &lt;/a&gt;I changed the link to &amp;lt;a href=&amp;#34; .../attachment/2749384?doAsUserId=xRdO8Wv72X5YHWlYGO&amp;#34; data-senna-off=&amp;#34;true&amp;#34;&amp;gt;&lt;br /&gt;It not only fixed that attachment issue, but also impersonating one.</summary>
    <dc:creator>Jan Tošovský</dc:creator>
    <dc:date>2019-10-02T16:05:42Z</dc:date>
  </entry>
  <entry>
    <title>RE: Impersonating friendly URLs</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117337138" />
    <author>
      <name>Jan Tošovský</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117337138</id>
    <updated>2019-10-02T14:19:13Z</updated>
    <published>2019-10-02T14:19:13Z</published>
    <summary type="html">Hi Olaf, a good point. I checked this in old 6.2 version and it works as expected there. Now I am on 7.2 GA1. So this seems to be a regression. I&amp;#39;ll test this on some core friendly URLs if it is really global issue or just a problem of my portlet.</summary>
    <dc:creator>Jan Tošovský</dc:creator>
    <dc:date>2019-10-02T14:19:13Z</dc:date>
  </entry>
  <entry>
    <title>RE: Impersonating friendly URLs</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117338062" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117338062</id>
    <updated>2019-10-02T09:04:58Z</updated>
    <published>2019-10-02T09:04:58Z</published>
    <summary type="html">&lt;div class="quote-title"&gt;Jan Tošovský:&lt;/div&gt;&lt;blockquote&gt;&lt;br /&gt;I am trying to pass doAsUserId param to my friendly URL &lt;br /&gt;&lt;/blockquote&gt;I probably can&amp;#39;t help you directly, but it might help to mention the exact Liferay version. And if there&amp;#39;s a newer GA on your major version, try if it&amp;#39;s an issue that was already fixed.</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2019-10-02T09:04:58Z</dc:date>
  </entry>
  <entry>
    <title>Impersonating friendly URLs</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117332932" />
    <author>
      <name>Jan Tošovský</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117332932</id>
    <updated>2019-10-01T19:09:00Z</updated>
    <published>2019-10-01T19:09:00Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;I am trying to pass doAsUserId param to my friendly URL .../attachment/2749384?doAsUserId=xRdO8Wv72X5YHWlYGO, but it is apparently not passed upstream.&lt;br&gt;When my route is processed and enters the serveResource() method, the user retrieved from resourceRequest is not that impersonated user, but real one. &lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;route&amp;gt;
&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;pattern&amp;gt;/attachment/{attachmentId:[^/]+}&amp;lt;/pattern&amp;gt;
&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;implicit-parameter name="p_p_lifecycle"&amp;gt;2&amp;lt;/implicit-parameter&amp;gt;
&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;implicit-parameter name="p_p_cacheability"&amp;gt;cacheLevelPage&amp;lt;/implicit-parameter&amp;gt;
&amp;amp;nbsp;&amp;amp;nbsp; &amp;lt;implicit-parameter name="mvcPath"&amp;gt;/attachment.jsp&amp;lt;/implicit-parameter&amp;gt;
&amp;lt;/route&amp;gt;
&lt;/code&gt;&lt;/pre&gt;This prevents to emulate some functionality from that specific user perspective. &lt;br&gt;Is there any workaround for this?&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Jan Tošovský</dc:creator>
    <dc:date>2019-10-01T19:09:00Z</dc:date>
  </entry>
</feed>
