<?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>Auth in Jax-rs liferay 7.2</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=117823353" />
  <subtitle>Auth in Jax-rs liferay 7.2</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=117823353</id>
  <updated>2026-04-04T00:02:39Z</updated>
  <dc:date>2026-04-04T00:02:39Z</dc:date>
  <entry>
    <title>RE: Auth in Jax-rs liferay 7.2</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120485006" />
    <author>
      <name>Enrico Costanzi</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120485006</id>
    <updated>2020-12-01T11:25:00Z</updated>
    <published>2020-12-01T11:25:00Z</published>
    <summary type="html">&lt;p&gt;You can invoke the jax-rs endpoint using Liferay.Util.fetch. Using
  this method the x-csrf-token header is sent and the endpoint responds correctly.&lt;/p&gt;
&lt;p&gt;If you want to call it via jquery (as I was trying to do) you have to
  disable cors.&lt;/p&gt;
&lt;p&gt;&amp;lt;%@ include file=&amp;quot;/init.jsp&amp;quot;
  %&amp;gt;&lt;br /&gt;&amp;lt;script&lt;br /&gt;      
   src=&amp;quot;https://code.jquery.com/jquery-3.5.1.min.js&amp;quot;&lt;br /&gt;  
     
   integrity=&amp;quot;sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=&amp;quot;&lt;br /&gt;  
       crossorigin=&amp;quot;anonymous&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;script&amp;gt;&lt;br /&gt;    $(document).ready(function(){&lt;br /&gt;        //
  works only if cors is disabled&lt;br /&gt;        $.get('/o/greetings',
  function (data){&lt;br /&gt;            console.log(data);&lt;br /&gt;        })&lt;/p&gt;
&lt;p&gt;        // always works, the fetch method sends the x-csrf-token
  header&lt;br /&gt;        Liferay.Util.fetch('/o/greetings', {&lt;br /&gt;      
       method: 'GET'&lt;br /&gt;        }).then(resp =&amp;gt;
  console.log(resp));&lt;br /&gt;  
   });&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;&lt;br /&gt;  
   &amp;lt;b&amp;gt;&amp;lt;liferay-ui:message key=&amp;quot;myapp.caption&amp;quot;/&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;To disable cors add
  `&amp;quot;auth.verifier.auth.verifier.PortalSessionAuthVerifier.check.csrf.token=false&amp;quot;`
  property to your component.&lt;/p&gt;
&lt;p&gt;@Component(&lt;br /&gt;    property = {&lt;br /&gt;      
   JaxrsWhiteboardConstants.JAX_RS_APPLICATION_BASE +
  &amp;quot;=/greetings&amp;quot;,&lt;br /&gt;      
   JaxrsWhiteboardConstants.JAX_RS_NAME +
  &amp;quot;=Greetings.Rest&amp;quot;,&lt;br /&gt;      
   &amp;quot;oauth2.scopechecker.type=none&amp;quot;,&lt;br /&gt;      
   &amp;quot;auth.verifier.auth.verifier.PortalSessionAuthVerifier.check.csrf.token=false&amp;quot;&lt;br /&gt;  
   },&lt;br /&gt;    service = Application.class&lt;br /&gt;)&lt;br /&gt;public class
  MyRestApiApplication extends Application {&lt;br /&gt;...&lt;/p&gt;</summary>
    <dc:creator>Enrico Costanzi</dc:creator>
    <dc:date>2020-12-01T11:25:00Z</dc:date>
  </entry>
  <entry>
    <title>RE: RE: Auth in Jax-rs liferay 7.2</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120482947" />
    <author>
      <name>Enrico Costanzi</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120482947</id>
    <updated>2020-12-01T12:13:31Z</updated>
    <published>2020-12-01T11:08:16Z</published>
    <summary type="html">&lt;p&gt;That was the problem, thank you. &lt;/p&gt;
&lt;p&gt;2020-12-01 11:07:41.853 DEBUG
  [http-nio-8080-exec-10][PortalSessionAuthVerifier:80] Unable to verify
  CSRF token for /o/greetings: User 38201 did not provide a valid CSRF
  token for /o/greetings&lt;/p&gt;</summary>
    <dc:creator>Enrico Costanzi</dc:creator>
    <dc:date>2020-12-01T11:08:16Z</dc:date>
  </entry>
  <entry>
    <title>RE: Auth in Jax-rs liferay 7.2</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120116356" />
    <author>
      <name>Andre Kreienbring</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120116356</id>
    <updated>2020-10-20T08:03:11Z</updated>
    <published>2020-10-20T08:03:11Z</published>
    <summary type="html">Hi, i&amp;#39;m working with 7.3.2. And Guest can not access my services by default. With or without this  &amp;#34;auth.verifier.guest.allowed=false&amp;#34; setting. &lt;br /&gt;Have you tried Postman or Curl with Basic Authentication while an account is logged in?</summary>
    <dc:creator>Andre Kreienbring</dc:creator>
    <dc:date>2020-10-20T08:03:11Z</dc:date>
  </entry>
  <entry>
    <title>RE: Auth in Jax-rs liferay 7.2</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120109418" />
    <author>
      <name>Christoph Rabel</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120109418</id>
    <updated>2020-10-18T10:37:08Z</updated>
    <published>2020-10-18T10:37:08Z</published>
    <summary type="html">Please increase the loglevel of these two packages:&lt;br /&gt;com.liferay.portal.servlet.filters.authverifier &lt;br /&gt;com.liferay.portal.security.auth.verifier.internal.portal.session &lt;br /&gt;(In Server Administration - &amp;gt; LogLevel -&amp;gt; Click Add button and add them)&lt;br /&gt;I suspect that you send no CSRF token. It is mandatory for PortalSessionAuthVerifier to grant you a &amp;#34;Success&amp;#34; state.</summary>
    <dc:creator>Christoph Rabel</dc:creator>
    <dc:date>2020-10-18T10:37:08Z</dc:date>
  </entry>
  <entry>
    <title>RE: Auth in Jax-rs liferay 7.2</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120100112" />
    <author>
      <name>Enrico Costanzi</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120100112</id>
    <updated>2020-10-15T15:57:43Z</updated>
    <published>2020-10-15T15:57:43Z</published>
    <summary type="html">Thank you @Andre, which version of liferay are you trying on?&lt;br /&gt; I&amp;#39;m invoking the service via jquery ajax call in a ftl portlet visibile only to logged in users. The cookie header is passed with the JSESSIONID in it so I was expecting liferay to accept api call.&lt;br /&gt;&lt;blockquote&gt;Having said that I wonder how  &amp;#34;auth.verifier.guest.allowed=false&amp;#34;, makes sense? Guest  has no password...&lt;br /&gt;&lt;/blockquote&gt;I&amp;#39;m not sure I understand the question. Only real authenticated user can invoke the api so I disabled the guest access to avoid anonymous user to use it. If I&amp;#39;m not mistaken this is the way to do it.</summary>
    <dc:creator>Enrico Costanzi</dc:creator>
    <dc:date>2020-10-15T15:57:43Z</dc:date>
  </entry>
  <entry>
    <title>RE: Auth in Jax-rs liferay 7.2</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120096621" />
    <author>
      <name>Andre Kreienbring</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120096621</id>
    <updated>2020-10-15T12:58:57Z</updated>
    <published>2020-10-15T12:58:57Z</published>
    <summary type="html">Hi, I can confirm that users who are logged in can access my REST service. Must be another issue here.&lt;br /&gt;&lt;br /&gt;How do you authenticate when you call your service(s)? At least by default only existing accounts can access them. So the most basic thing is to use Basic Authentication.&lt;br /&gt;&lt;br /&gt;Having said that I wonder how  &amp;#34;auth.verifier.guest.allowed=false&amp;#34;, makes sense? Guest  has no password...&lt;br /&gt;Anyway, I added that to my service and still saw the exact same behavior as before.</summary>
    <dc:creator>Andre Kreienbring</dc:creator>
    <dc:date>2020-10-15T12:58:57Z</dc:date>
  </entry>
  <entry>
    <title>RE: Auth in Jax-rs liferay 7.2</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120097345" />
    <author>
      <name>Enrico Costanzi</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120097345</id>
    <updated>2020-10-14T15:55:29Z</updated>
    <published>2020-10-14T15:55:29Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;I'm having the same issue with Liferay Community Edition Portal 7.3.0 CE GA1. &lt;br&gt;The problem: Logged in users cannot invoke the JAX-RS API, receiving a 403 error.&lt;br&gt;I defined the component&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;@Component(
        property = {
                JaxrsWhiteboardConstants.JAX_RS_APPLICATION_BASE + "=/issue-admin-rest-api/project",
                JaxrsWhiteboardConstants.JAX_RS_NAME + "=Project.Configuration",
                "auth.verifier.guest.allowed=false",
                "oauth2.scopechecker.type=none"
        },
        service = Application.class
)
public class AdminRestAPIApplication extends Application {
...&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;Now I'm logged in as Administrator but every ajax call from the browser returns a 403 error. The response is:&lt;br&gt;&lt;pre&gt;&lt;code&gt;[code]

    &amp;lt;title&amp;gt;Http Status 403 - http-status-code[403]&amp;lt;/title&amp;gt;


&amp;lt;h1&amp;gt;Http Status 403 - http-status-code[403]&amp;lt;/h1&amp;gt;
&amp;lt;p&amp;gt;
    Message: Authorization required&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;
    Resource: /o/issue-admin-rest-api/project/FPT&amp;lt;/p&amp;gt;

&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;I want to be enable the PortalSessionAuthVerifier for it. So that logged in users (non guest) will be able to invoke this API. I tried to:&lt;br&gt;- add the method to the Service Access Policy&lt;br&gt;- go to System Settings &amp;gt; Web Api &amp;gt; CXF ENDPOINTS and add a cxf endpoint on&amp;nbsp;&lt;span style="font-size: 18px;"&gt;/issue-admin-rest-api and&amp;nbsp;/issue-admin-rest-api/project using&amp;nbsp;&lt;em&gt;auth.verifier.PortalSessionAuthVerifier.urls.includes=*&lt;/em&gt;&lt;/span&gt;&lt;br&gt;&lt;span style="font-size: 18px;"&gt;&lt;em&gt;​​​​​​​&lt;/em&gt;&lt;/span&gt;&lt;span style="font-size: 18px;"&gt;- go to System Settings &amp;gt; API Authentication &amp;gt; Portal Sessions and to enable the path&lt;/span&gt;&amp;nbsp;&lt;em&gt;/o/issue-admin-rest-api*&lt;/em&gt;&lt;br&gt;&lt;em&gt;&lt;/em&gt;&lt;br&gt;&lt;em&gt;​​​​​​​&lt;/em&gt;None of the above works, i keep getting a 403 as a response. Am I missing something?&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Enrico Costanzi</dc:creator>
    <dc:date>2020-10-14T15:55:29Z</dc:date>
  </entry>
  <entry>
    <title>RE: Auth in Jax-rs liferay 7.2</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117947207" />
    <author>
      <name>Christoph Rabel</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117947207</id>
    <updated>2019-12-02T14:14:47Z</updated>
    <published>2019-12-02T14:14:47Z</published>
    <summary type="html">You need to add an access policy to SYSTEM_DEFAULT.&lt;br /&gt;In your code here, OAuth is required. So you would need to send an OAuth token to access the methods.&lt;br /&gt;You can disable oauth (add  &amp;#34;oauth2.scopechecker.type=none&amp;#34; to the properties), but as you found out, you will be blocked by the access control.&lt;br /&gt;To get around that, go to Control Panel -&amp;gt; Configuration -&amp;gt; Service Access Policy -&amp;gt; System_Default (it already contains getCountries and getRegions).&lt;br /&gt;Add your own class/method to it.&lt;br /&gt;package.itemsRESTApplication#working&lt;br /&gt;or maybe even&lt;br /&gt;package.itemsRESTApplication#*&lt;br /&gt;if you want to allow access to all methods of your class.</summary>
    <dc:creator>Christoph Rabel</dc:creator>
    <dc:date>2019-12-02T14:14:47Z</dc:date>
  </entry>
  <entry>
    <title>RE: Auth in Jax-rs liferay 7.2</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117904391" />
    <author>
      <name>Alessio luna</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117904391</id>
    <updated>2019-11-27T10:39:45Z</updated>
    <published>2019-11-27T10:39:45Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Thanks for your answer. Probably I articulated too much the question and missleaded the response. Lets keep it simple:&lt;br&gt;I have a jax-rs:&lt;br&gt;&lt;pre&gt;&lt;code&gt;
@Component(
	property = {
		JaxrsWhiteboardConstants.JAX_RS_APPLICATION_BASE + "=/items",
		JaxrsWhiteboardConstants.JAX_RS_NAME + "=Items.Rest",
		"auth.verifier.guest.allowed=false",

	},
	service = Application.class
)
public class itemsRESTApplication extends Application {
	public Set&amp;lt;object&amp;gt; getSingletons() {
		return Collections.&amp;lt;object&amp;gt;singleton(this);
	}

	@GET
	@Produces("application/json")
	public String working(){return "hello!";}
&amp;lt;br&amp;gt;I want to be able to call this endpoint /o/test just because I'm already logged in in liferay. So no guest allowed but I just want session ID from browser like every call you do in api/jsonws and so on. How to setup this jaxrs/liferay configuration for let this happen ? Because If I try to call with browser the above service I get in console: &amp;lt;br&amp;gt;2019-11-27 10:32:15.159 WARN&amp;amp;nbsp; [http-nio-8080-exec-5][code_jsp:175] {code="403", msg="Authorization required", uri=/o/items}&amp;lt;br&amp;gt;Even if I AM logged in as Administrator.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Thanks&amp;lt;/object&amp;gt;&amp;lt;/object&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Alessio luna</dc:creator>
    <dc:date>2019-11-27T10:39:45Z</dc:date>
  </entry>
  <entry>
    <title>RE: Auth in Jax-rs liferay 7.2</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117903616" />
    <author>
      <name>Christoph Rabel</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117903616</id>
    <updated>2019-11-26T19:15:52Z</updated>
    <published>2019-11-26T19:15:52Z</published>
    <summary type="html">Well, it is a bit complicated and I am not 100% sure, I understand all of it. So, if I am wrong here, please correct me.&lt;br /&gt;But as far as I know:&lt;br /&gt;&lt;br /&gt;AuthVerifiers just provide you with a user, if there are credentials (e.g. through Basic Auth), they provide the authorization context .&lt;br /&gt;So:&lt;br /&gt;User without cookie/credentials accesses the API -&amp;gt; guest user is set.&lt;br /&gt;Cookie, Username/PW, &amp;lt;something else&amp;gt; is sent with the request -&amp;gt; user is set.&lt;br /&gt;Consider it a form of &amp;#34;autologin&amp;#34;. If something is in the request, that allows authentication, the Verifier will make sure that the credentials are processed when accessing the API.&lt;br /&gt;OAuth is a different beast. OAuth is all about authorization, it isn&amp;#39;t about authentication:&lt;br /&gt;OAuth tests if access is allowed by a scope. With none, you can tell the system, that you don&amp;#39;t want OAuth and the scope shouldn&amp;#39;t be checked. OAuth works on the path, so accessing /a/b/c might be allowed using OAuth. But it doesn&amp;#39;t check permissions per se, or who you are.&lt;br /&gt;It could be compared to a bus ticket. If you have a ticket, you can use the bus. But it doesn&amp;#39;t matter, who you are, just that you have the ticket.&lt;br /&gt;And then there is AccessControlled:&lt;br /&gt;It is also about authorization, but it was already there in Liferay 6. It is about allowing access to call single functions.&lt;br /&gt;You can find an example in Control Panel -&amp;gt; Configuration -&amp;gt; Service Access Policy&lt;br /&gt;Take a look at SYSTEM_DEFAULT. It allows access to com.liferay.portal.kernel.service.CountryService.getCountries() for authenticated users. When you set &amp;#34;liferay.access.control.disable=true&amp;#34;, then you disable that check and allow access to your service to guest users.</summary>
    <dc:creator>Christoph Rabel</dc:creator>
    <dc:date>2019-11-26T19:15:52Z</dc:date>
  </entry>
  <entry>
    <title>RE: Auth in Jax-rs liferay 7.2</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117894256" />
    <author>
      <name>Alessio luna</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117894256</id>
    <updated>2019-11-26T08:36:12Z</updated>
    <published>2019-11-26T08:36:12Z</published>
    <summary type="html">bump. I &amp;#39;m still not able to use regular portalSession auth in jaxrs. Ended up to keep the endpoint public with the user.isDefaultUser() test. This is a bad practice because for example to use getExpandoBridge.getAttribute I have to modify the Service Access Policy of expandoBridge#getData and on top of this make custom fields viewable by &amp;#34;guest&amp;#34;, even if I&amp;#39;m tenchincally logged in. Can someone please help or point me out where to read &amp;#34;how to use portalsession auth in jax-rs ?&amp;#34;</summary>
    <dc:creator>Alessio luna</dc:creator>
    <dc:date>2019-11-26T08:36:12Z</dc:date>
  </entry>
  <entry>
    <title>RE: Auth in Jax-rs liferay 7.2</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117825053" />
    <author>
      <name>Alessio luna</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117825053</id>
    <updated>2019-11-19T08:55:21Z</updated>
    <published>2019-11-19T08:55:21Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;First of all, thanks for your answer. I tried following the thread but found some&amp;nbsp;&lt;span style="font-size: 16px;"&gt;inconsistencies&amp;nbsp;&lt;/span&gt;from what I see.&lt;br&gt; I ended up with a working service with some difference:&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;@Component(
   property = {
      JaxrsWhiteboardConstants.JAX_RS_APPLICATION_BASE+ "=/greetings",
      JaxrsWhiteboardConstants.JAX_RS_NAME+ "=Greetings.Rest",
         "auth.verifier.guest.allowed=true",
         "oauth2.scopechecker.type=none",
         /*"liferay.access.control.disable=true",*/
         /*"auth.verifier.auth.verifier.PortalSessionAuthVerifier.urls.includes=/*"*/
   },
   service = Application.class
)
public class ItemsServiceApplication extends Application {

   public Set&amp;lt;object&amp;gt; getSingletons() {
      return Collections.&amp;lt;object&amp;gt;singleton(this);
   }

   @GET
   @Produces("text/plain")
   public String working(@Context HttpServletRequest request) throws PortalException {

      User user=PortalUtil.getUser(request);
      if(user.isDefaultUser()){
         throw new PortalException("Not logged, byeeeeeeeeeeeeee");
      }

      return user.getFullName(); //&amp;amp;lt;-- it works!
   }&amp;lt;br&amp;gt;The difference between my liferay version and that example is:&amp;lt;br&amp;gt;if I just use&amp;amp;nbsp; "auth.verifier.guest.allowed=true", "oauth2.scopechecker.type=none", still doesnt work. I get this message even if logged in:&amp;amp;lt;Forbidden&amp;amp;gt;&amp;amp;lt;message&amp;amp;gt;Access denied to com.packet.test#working&amp;amp;lt;/message&amp;amp;gt;&amp;amp;lt;/Forbidden&amp;amp;gt;&amp;lt;br&amp;gt;But If I put&amp;amp;nbsp;"liferay.access.control.disable=true", then I can avoid also the&amp;amp;nbsp;oauth2.scopechecker.type, I can call the endpoint from browser and console.&amp;lt;br&amp;gt;I find all this configuration thing really really confusing. Basically I'm still unable to use the "portalSession", If I put the&amp;amp;nbsp; /*"auth.verifier.auth.verifier.PortalSessionAuthVerifier.urls.includes=/*"*/ &amp;lt;br&amp;gt;At that point i dont get the message&amp;amp;nbsp;&amp;amp;lt;Forbidden&amp;amp;gt;&amp;amp;lt;message&amp;amp;gt; but a Redirect to localhost:8080 and I see in liferay console:&amp;lt;br&amp;gt;2019-11-19 08:54:10.792 WARN &amp;amp;nbsp;[http-nio-8080-exec-3][code_jsp:?] {code="403", msg="Authorization required", uri=/o/greetings/}&amp;lt;br&amp;gt;How Am I suppose to authenticate here using PortalSession ?&amp;lt;br&amp;gt;Thanks!&amp;lt;/object&amp;gt;&amp;lt;/object&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Alessio luna</dc:creator>
    <dc:date>2019-11-19T08:55:21Z</dc:date>
  </entry>
  <entry>
    <title>RE: Auth in Jax-rs liferay 7.2</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117824685" />
    <author>
      <name>Christoph Rabel</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117824685</id>
    <updated>2019-11-19T07:25:05Z</updated>
    <published>2019-11-19T07:25:05Z</published>
    <summary type="html">&lt;a href="https://liferay.dev/forums/-/message_boards/message/112794830"&gt;https://liferay.dev/forums/-/message_boards/message/112794830&lt;/a&gt;&lt;br /&gt;This thread should help you.</summary>
    <dc:creator>Christoph Rabel</dc:creator>
    <dc:date>2019-11-19T07:25:05Z</dc:date>
  </entry>
  <entry>
    <title>Auth in Jax-rs liferay 7.2</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117823352" />
    <author>
      <name>Alessio luna</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117823352</id>
    <updated>2019-11-18T20:23:05Z</updated>
    <published>2019-11-18T20:23:05Z</published>
    <summary type="html">Hi everybody,I&amp;#39;m sorry but after 2 full work days of trying I&amp;#39;m very confused and stressed, so maybe I will appear strange but If I dont find a solution I cant sleep well. So let&amp;#39;s get straight to the point.My ultimate goal:&lt;br /&gt;Im developing multiple portlet based on angular 8 that call different liferay &amp;#34;services&amp;#34; to display things.&lt;br /&gt;Calling service-builders via Liferay.Service (via javascript) it&amp;#39;s a cake everything is just smooth and fine.&lt;br /&gt;Now I need to develop a &amp;#34;custom service&amp;#34; not based on service builder, there is no persistence, I just need to do some calculation&lt;br /&gt;based on user logged in and other data coming from different *localServices.&lt;br /&gt;&lt;br /&gt;This is where my troubles began.&lt;br /&gt;I tried to make a &amp;#34;rest&amp;#34; service via blade (i.e blade create -t rest blabla), it comes with something like this:&lt;br /&gt;@Component( &lt;br /&gt;        property = { &lt;br /&gt;            JaxrsWhiteboardConstants.JAX_RS_APPLICATION_BASE + &amp;#34;=/greetings&amp;#34;, &lt;br /&gt;            JaxrsWhiteboardConstants.JAX_RS_NAME + &amp;#34;=Greetings.Rest&amp;#34;,&lt;br /&gt;            &amp;#34;auth.verifier.guest.allowed=false&amp;#34;&lt;br /&gt;        }, &lt;br /&gt;        service = Application.class)&lt;br /&gt;&lt;br /&gt;following the docs from:https://portal.liferay.dev/docs/7-2/frameworks/-/knowledge_base/f/jax-rsI end up having a service exposed to : localhost:8080/o/greetings&lt;br /&gt;Thats cool, the only problem I dont know how to call it with sessionID from BROWSER or from Liferay.Service(..) using an already logged in user&lt;br /&gt;Give it simple, I want be non logged go to localhost:8080/ogreetings via browser or via Liferay.Service(..) and see &amp;#34;forbidden blabla fuck you.&amp;#34;&lt;br /&gt;Then I want to login in liferay using standard login form at localhost:8080/ then after auth I want go to localhost:8080/o/greetings via browser &lt;br /&gt;or Liferay.Service(localhost:8080/o/@@@@ blabla) and see the response from service.&lt;br /&gt;&lt;br /&gt;So it&amp;#39;s a &amp;#34;simple&amp;#34; matter of how to configure the authentication and authorization of a brand new Rest service deployed to /o/greetings.I cant use Oauth2, there is no point to get an access token just for 1 service out of the 6 (service-builder) I&amp;#39;m calling just fine with Liferay.Service(..)[Javascript api] &lt;br /&gt;&lt;br /&gt;I want just auth via sessionID like the ones from /api/json-ws (seamless).&lt;br /&gt;&lt;br /&gt;Thanks to everybody that will save me &lt;img alt="emoticon" src="@theme_images_path@/emoticons/happy.gif" &gt;&lt;br /&gt;p.s using liferay:portal/7.2.0-ga1/liferay-ce-portal-tomcat-7.2.0-ga1-20190531153709761.tar.gz</summary>
    <dc:creator>Alessio luna</dc:creator>
    <dc:date>2019-11-18T20:23:05Z</dc:date>
  </entry>
</feed>
