<?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>Headless Delivery API only supports BASIC AUTH?</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=118790455" />
  <subtitle>Headless Delivery API only supports BASIC AUTH?</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=118790455</id>
  <updated>2026-04-04T00:12:06Z</updated>
  <dc:date>2026-04-04T00:12:06Z</dc:date>
  <entry>
    <title>RE: Headless Delivery API only supports BASIC AUTH?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118872480" />
    <author>
      <name>Kirk Cunningham</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118872480</id>
    <updated>2020-04-07T09:19:13Z</updated>
    <published>2020-04-07T09:19:13Z</published>
    <summary type="html">&lt;div class="quote-title"&gt;Javier Gamarra:&lt;/div&gt;&lt;blockquote&gt;&lt;br /&gt;Headless APIs support the same auth mechanism as the portal (OAuth, session, basic). The issue there is the CSRF check, either you disable it or pass the p_p_auth token. It&amp;#39;s briefly explained here: &lt;a href="https://portal.liferay.dev/docs/7-2/frameworks/-/knowledge_base/f/making-authenticated-rest-api-requests#using-cookie-authentication-or-making-requests-from-the-ui"&gt;https://portal.liferay.dev/docs/7-2/frameworks/-/knowledge_base/f/making-authenticated-rest-api-requests#using-cookie-authentication-or-making-requests-from-the-ui&lt;/a&gt;/&lt;a href="https://www.mygroundbiz.mobi/"&gt;MyGroundBiz&lt;/a&gt;&lt;/blockquote&gt;love it thank for the valuable information…</summary>
    <dc:creator>Kirk Cunningham</dc:creator>
    <dc:date>2020-04-07T09:19:13Z</dc:date>
  </entry>
  <entry>
    <title>RE: Headless Delivery API only supports BASIC AUTH?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118795283" />
    <author>
      <name>Javier Gamarra</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118795283</id>
    <updated>2020-03-23T16:24:24Z</updated>
    <published>2020-03-23T16:24:24Z</published>
    <summary type="html">In a new tab, It&amp;#39;s going to fail unless you disable CSRF checks for urls like /o/headless... or you propagate the p_p_auth token (that you already have). You are doing a request in a new tab and logged so the browser attachs the cookie identifier (so you are logged) but it doesn&amp;#39;t send any other headers to avoid other sites trying to impersonate you.&lt;br /&gt;If you want to call if from JS code you have to use fetch or a JS request library, Liferay.Service integrates with Java services but is not meant to be used with headless REST endpoints. You won&amp;#39;t have to propagate anything because the request will be decorated automatically, because you will do it from a liferay loaded page (vs an API call directly).</summary>
    <dc:creator>Javier Gamarra</dc:creator>
    <dc:date>2020-03-23T16:24:24Z</dc:date>
  </entry>
  <entry>
    <title>RE: Headless Delivery API only supports BASIC AUTH?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118793463" />
    <author>
      <name>Michael Freeman</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118793463</id>
    <updated>2020-03-23T11:55:57Z</updated>
    <published>2020-03-23T11:55:57Z</published>
    <summary type="html">I don&amp;#39;t think I follow why CSRF applies here unless i am missing something. Bit that&amp;#39;s OK ...&lt;br /&gt;I have logged into Liferay, and am sitting on the welcome page. I type the link to the Open API YAML spec endpoint. I receive an &amp;#34;Access Forbidden&amp;#34; error. Are you saying that&amp;#39;s always going to fail that way without a token?&lt;br /&gt;&lt;br /&gt;And then when i make a Liferay.Service() call in JavasSript will it handle the token  acquisition automaticlaly?</summary>
    <dc:creator>Michael Freeman</dc:creator>
    <dc:date>2020-03-23T11:55:57Z</dc:date>
  </entry>
  <entry>
    <title>RE: Headless Delivery API only supports BASIC AUTH?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118791086" />
    <author>
      <name>Javier Gamarra</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118791086</id>
    <updated>2020-03-23T10:07:45Z</updated>
    <published>2020-03-23T10:07:45Z</published>
    <summary type="html">Headless APIs support the same auth mechanism as the portal (OAuth, session, basic). The issue there is the CSRF check, either you disable it or pass the p_p_auth token. It&amp;#39;s briefly explained here: &lt;a href="https://portal.liferay.dev/docs/7-2/frameworks/-/knowledge_base/f/making-authenticated-rest-api-requests#using-cookie-authentication-or-making-requests-from-the-ui"&gt;https://portal.liferay.dev/docs/7-2/frameworks/-/knowledge_base/f/making-authenticated-rest-api-requests#using-cookie-authentication-or-making-requests-from-the-ui&lt;/a&gt;</summary>
    <dc:creator>Javier Gamarra</dc:creator>
    <dc:date>2020-03-23T10:07:45Z</dc:date>
  </entry>
  <entry>
    <title>Headless Delivery API only supports BASIC AUTH?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118790454" />
    <author>
      <name>Michael Freeman</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118790454</id>
    <updated>2020-03-22T20:16:04Z</updated>
    <published>2020-03-22T20:16:04Z</published>
    <summary type="html">The documentation for the REST APIs states that the APIs can be accessed by logged-in users but trying to access one of the GET based APIs in the browser after logging in results in an &amp;#34;Access Forbidden&amp;#34; error.&lt;br /&gt;&lt;br /&gt;It only seems to work in Postman/curl scenarios where i use BASIC AUTH to access the API</summary>
    <dc:creator>Michael Freeman</dc:creator>
    <dc:date>2020-03-22T20:16:04Z</dc:date>
  </entry>
</feed>
