Message Boards

?doAsUserId in the url

Nikita Laitinen, modified 3 Years ago.

?doAsUserId in the url

Junior Member Posts: 44 Join Date: 12/18/19 Recent Posts
Hi!

I have an issue and I hope you could help me

LifeRay adds to  URLs  this thing 
?doAsUserId=someuserid
 . Is it possible to fix it somehow? (I don't want to have it there) At least for guest mode


For example, we have links without param doAsUserId but liferay add to them this param  like following
 
[url=https://www.valamis.com/hub/collaborative-learning?doAsUserId=xrawawbqbr]https://someurl?doAsUserId=xrawawbqbr
https://anothersomeurl?doAsUserId=xrawawbwgwgqbr
[/url]

and finally, google bot  crawl these pages (there are a lot of links like that)

We have the original links without param and links with this param.  All of them works, but for google bot they are soft 404

What is doAsUserId? Why is it necessary and why it exists in the url? How to remove this param from adding to URL?

Thank you!
 
thumbnail
Olaf Kock, modified 3 Years ago.

RE: ?doAsUserId in the url

Liferay Legend Posts: 6403 Join Date: 9/23/08 Recent Posts
Nikita Laitinen:

Liferay adds to  URLs  this thing 
?doAsUserId=someuserid
 . Is it possible to fix it somehow? (I don't want to have it there) At least for guest mode

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.
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.
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.
Nikita Laitinen, modified 3 Years ago.

RE: ?doAsUserId in the url

Junior Member Posts: 44 Join Date: 12/18/19 Recent Posts
Good explanation!
​​​​​​​Thank you!