<?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>?doAsUserId in the url</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120033886" />
  <subtitle>?doAsUserId in the url</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120033886</id>
  <updated>2026-06-12T23:49:13Z</updated>
  <dc:date>2026-06-12T23:49:13Z</dc:date>
  <entry>
    <title>RE: ?doAsUserId in the url</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120113957" />
    <author>
      <name>Nikita Laitinen</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120113957</id>
    <updated>2020-10-20T06:35:33Z</updated>
    <published>2020-10-20T06:35:33Z</published>
    <summary type="html">Good explanation!&lt;br /&gt;​​​​​​​Thank you!</summary>
    <dc:creator>Nikita Laitinen</dc:creator>
    <dc:date>2020-10-20T06:35:33Z</dc:date>
  </entry>
  <entry>
    <title>RE: ?doAsUserId in the url</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120034603" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120034603</id>
    <updated>2020-10-02T11:19:12Z</updated>
    <published>2020-10-02T11:19:12Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;div class="quote-title"&gt;Nikita Laitinen:&lt;/div&gt;&lt;blockquote&gt;&lt;br&gt;Liferay adds to &amp;nbsp;URLs&amp;nbsp; this thing&amp;nbsp;&lt;pre&gt;&lt;code&gt;?doAsUserId=someuserid&lt;/code&gt;&lt;/pre&gt;&amp;nbsp;. Is it possible to fix it somehow? (I don't want to have it there) At least for guest mode&lt;br&gt;&lt;br&gt;&lt;/blockquote&gt;I'm not aware where this would happen by default, unless someone copies/pastes a link somewhere. doAsUserId requires "impersonification" (or similar - what's the exact word?) permissions, e.g. an administrator can check how a particular page looks for a different user that they can act as. AFAIK that's the only usecase for it, and getting to that URL requires actively clicking on the "Impersonate" link in user management.&lt;br&gt;I'm not sure what happens when you start on such a URL, e.g. if it continues to get attached to other generated URLs. I'm assuming that this is what you're seeing because at least once such a URL has been explicitly added somewhere.&lt;br&gt;Alternatively it might also be some plugin or external application that generates such a link. Find where the link is present on a page that you request without this parameter and eliminate it there.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2020-10-02T11:19:12Z</dc:date>
  </entry>
  <entry>
    <title>?doAsUserId in the url</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120033885" />
    <author>
      <name>Nikita Laitinen</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120033885</id>
    <updated>2020-10-02T11:02:45Z</updated>
    <published>2020-10-02T11:02:45Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi!&lt;br&gt;&lt;br&gt;I have an issue and I hope you could help me&lt;br&gt;&lt;br&gt;LifeRay adds to &amp;nbsp;URLs&amp;nbsp; this thing&amp;nbsp;&lt;pre&gt;&lt;code&gt;?doAsUserId=someuserid&lt;/code&gt;&lt;/pre&gt;&amp;nbsp;. Is it possible to fix it somehow? (I don't want to have it there) At least for guest mode&lt;br&gt;&lt;br&gt;&lt;br&gt;For example, we have links without param doAsUserId but liferay add to them this param&amp;nbsp; like following&lt;br&gt;&amp;nbsp;&lt;u&gt;&lt;a href="https://www.valamis.com/hub/collaborative-learning?doAsUserId=xrawawbqbr"&gt;&lt;/a&gt;&lt;/u&gt;&lt;pre&gt;&lt;code&gt;[url=https://www.valamis.com/hub/collaborative-learning?doAsUserId=xrawawbqbr]https://someurl?doAsUserId=xrawawbqbr
https://anothersomeurl?doAsUserId=xrawawbwgwgqbr
[/url]&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;and finally, google bot&amp;nbsp; crawl these pages (there are a lot of links like that)&lt;br&gt;&lt;br&gt;We have the original links without param and links with this param.&amp;nbsp; All of them works, but for google bot they are&amp;nbsp;soft 404&lt;br&gt;&lt;br&gt;What is doAsUserId? Why is it necessary and why it exists in the url? How to remove this param&amp;nbsp;from adding to URL?&lt;br&gt;&lt;br&gt;Thank you!&lt;br&gt;&amp;nbsp;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Nikita Laitinen</dc:creator>
    <dc:date>2020-10-02T11:02:45Z</dc:date>
  </entry>
</feed>
