<?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>Liferay remote service access for all users</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119473083" />
  <subtitle>Liferay remote service access for all users</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119473083</id>
  <updated>2026-04-07T09:05:13Z</updated>
  <dc:date>2026-04-07T09:05:13Z</dc:date>
  <entry>
    <title>RE: Liferay remote service access for all users</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119475864" />
    <author>
      <name>Christoph Rabel</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119475864</id>
    <updated>2020-06-24T12:51:45Z</updated>
    <published>2020-06-24T12:51:45Z</published>
    <summary type="html">I guess, it is the missing authToken parameter. Liferay checks if the parameter is there for security reasons, to make sure that the call was actually made by the current user. I don&amp;#39;t know if you can disable the check for one specific method only.&lt;br /&gt;If you call it from a Liferay page, you can add the p_auth parameter yourself. Even if you don&amp;#39;t want to use the Liferay object, just using window.Liferay.authToken is probably not a big deal.&lt;br /&gt;Another way to solve this would be to implement the service method using the rest template instead of through service builder. That approach really has a lot of merits since you are far more flexible with the interfaces you can provide and you also have a lot more control about things like authentication. (There is also the rest builder, &lt;a href="https://help.liferay.com/hc/en-us/articles/360028708852-Introduction-to-REST-Builder"&gt;https://help.liferay.com/hc/en-us/articles/360028708852-Introduction-to-REST-Builder&lt;/a&gt;  which might also be useful if you plan to have lots of rest services)</summary>
    <dc:creator>Christoph Rabel</dc:creator>
    <dc:date>2020-06-24T12:51:45Z</dc:date>
  </entry>
  <entry>
    <title>Liferay remote service access for all users</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119473082" />
    <author>
      <name>Rafał Pydyniak</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119473082</id>
    <updated>2020-06-24T10:48:23Z</updated>
    <published>2020-06-24T10:48:23Z</published>
    <summary type="html">Hello,&lt;br /&gt;I have a problem with using remote services. I have method findAll() in my *Service. This method just returns some entities from database. We want these data to be accessible for both logged users and guests. I have therefore added ServiceAccessPolicy for my Service and it works great for guests users - I get the JSON with data when I enter the url&lt;a href=""&gt;http://localhost:8080/api/jsonws/invoke?cmd={%22/mynamespace.data/find-all%22:{}}&lt;/a&gt; &lt;br /&gt;(the namespace and table names are changed)But when I try to enter the exactly same URL as logged user (either admin user or just newly created user without any additional roles) I get the error:&lt;img src="/documents/portlet_file_entry/14/image--tempRandomSuffix--ALLemfZz.png/e9663dad-3e12-a1c9-0d17-430d17c8b175" /&gt;&lt;br /&gt;So basically I can enter the URL as guest but I can&amp;#39;t as an administrator which seems quite weird for me. When I try with p_auth parameter obtained from Liferay.auth it works fine (so the same url but with &amp;amp;p_auth=MY_TOKEN)But I&amp;#39;d like not to use the p_auth because we don&amp;#39;t want to use Liferay object&lt;br /&gt;I know I could also:&lt;ul style="list-style: disc outside;"&gt;&lt;li&gt;Use basic authentication - but in my case I can&amp;#39;t because we&amp;#39;re actually calling the REST from React application embedded in MVCPortlet and this React app doesn&amp;#39;t have the username/password&lt;/li&gt;&lt;li&gt;Use Liferay.Service - we don&amp;#39;t want to use Liferay object at all&lt;/li&gt;&lt;/ul&gt;Any clues? Perhaps it&amp;#39;s a bug in Liferay remote services?&lt;br /&gt;I&amp;#39;m using Liferay 7.0.6 GA7 at the moment (we&amp;#39;re moving to DXP but it&amp;#39;s a process that takes time ;))&lt;br /&gt;Best regardsRafał</summary>
    <dc:creator>Rafał Pydyniak</dc:creator>
    <dc:date>2020-06-24T10:48:23Z</dc:date>
  </entry>
</feed>
