<?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>Invoke JAXRS Whiteboard endpoints using Portal Session with liferay 7.3</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120097876" />
  <subtitle>Invoke JAXRS Whiteboard endpoints using Portal Session with liferay 7.3</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120097876</id>
  <updated>2026-04-05T10:34:06Z</updated>
  <dc:date>2026-04-05T10:34:06Z</dc:date>
  <entry>
    <title>RE: Invoke JAXRS Whiteboard endpoints using Portal Session with liferay 7.3</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120483014" />
    <author>
      <name>Enrico Costanzi</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120483014</id>
    <updated>2020-12-01T12:13:53Z</updated>
    <published>2020-12-01T11:34:23Z</published>
    <summary type="html">&lt;p&gt;I was trying to invoke the JAX-RS endpoint using jquery. Jquery
  doesn't send the x-csrf-token and I always got a 403 in response. &lt;/p&gt;
&lt;p&gt;There are 2 possible solutions:&lt;/p&gt;
&lt;p&gt;1. Use `Liferay.Util.fetch` method instead of jquery `get`.&lt;/p&gt;
&lt;p&gt;2. Disable the csrf token check on the jaxrs component and keep using jquery. &lt;/p&gt;
&lt;pre&gt;@Component(
   property = {
      JaxrsWhiteboardConstants.JAX_RS_APPLICATION_BASE + &amp;quot;=/greetings&amp;quot;,
      JaxrsWhiteboardConstants.JAX_RS_NAME + &amp;quot;=Greetings.Rest&amp;quot;,
      &amp;quot;oauth2.scopechecker.type=none&amp;quot;,
      &amp;quot;auth.verifier.auth.verifier.PortalSessionAuthVerifier.check.csrf.token=false&amp;quot;
   },
   service = Application.class
)&lt;/pre&gt;</summary>
    <dc:creator>Enrico Costanzi</dc:creator>
    <dc:date>2020-12-01T11:34:23Z</dc:date>
  </entry>
  <entry>
    <title>Invoke JAXRS Whiteboard endpoints using Portal Session with liferay 7.3</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120097875" />
    <author>
      <name>Enrico Costanzi</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120097875</id>
    <updated>2020-10-15T09:14:54Z</updated>
    <published>2020-10-15T09:14:54Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;I created a JAX-RS application using blade.The application class is configured with these properties.&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;[code]@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;pre&gt;&lt;code&gt;}&lt;/code&gt;&lt;/pre&gt;The &lt;a href="https://help.liferay.com/hc/en-us/articles/360031902292-JAX-RS"&gt;documentation&lt;/a&gt;&amp;nbsp;states: "When you deploy a JAX-RS application, an&amp;nbsp;&lt;a href="https://help.liferay.com/hc/en-us/articles/360029031751-Authentication-Verifiers"&gt;Auth Verifier&lt;/a&gt;&amp;nbsp;filter is registered for it." and then says how to disable basic auth keeping only portal session and oauth2.&amp;nbsp;&lt;br&gt;&lt;br&gt;When I'm logged in as admin and&amp;nbsp;try to invoke these API via javascript I always get a 403 response error. The JSESSIONID is sent over the Cookie header to the API so I'm expecting the API to respond instead of refusing all the requests.I tried different approaches (CXF endpoints, Service Access Policy, API Authentication, AuthVerifierFilterTracker.config) but none of them worked.&amp;nbsp;&lt;br&gt;&lt;br&gt;How can I configure the module so that logged in users can invoke the API?&amp;nbsp;Using Liferay&amp;nbsp;Liferay Community Edition Portal 7.3.0 CE GA1.&lt;br&gt;&lt;br&gt;Related questions:&amp;nbsp;&lt;br&gt;&lt;a href="https://liferay.dev/forums/-/message_boards/message/119533528"&gt;https://liferay.dev/forums/-/message_boards/message/119533528&lt;/a&gt;&amp;nbsp;&lt;br&gt;&lt;a href="https://liferay.dev/forums/-/message_boards/message/117823352"&gt;https://liferay.dev/forums/-/message_boards/message/117823352&lt;/a&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Enrico Costanzi</dc:creator>
    <dc:date>2020-10-15T09:14:54Z</dc:date>
  </entry>
</feed>
