<?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>Custom authentication for headless API</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120065791" />
  <subtitle>Custom authentication for headless API</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120065791</id>
  <updated>2026-05-10T16:30:20Z</updated>
  <dc:date>2026-05-10T16:30:20Z</dc:date>
  <entry>
    <title>RE: Custom authentication for headless API</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120421401" />
    <author>
      <name>Fabian Bouché</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120421401</id>
    <updated>2020-11-09T08:26:06Z</updated>
    <published>2020-11-09T08:26:06Z</published>
    <summary type="html">&lt;p&gt;Hi Andrej,&lt;/p&gt;
&lt;p&gt;I've achieved what you're looking at. You can check a sample project
  over here: &lt;a href="https://github.com/fabian-bouche-liferay/external-oauth"&gt;https://github.com/fabian-bouche-liferay/external-oauth&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I've also talked to Carlos and I agree that RFC 8693 would be an
  easier solution to address this same requirement.&lt;/p&gt;
&lt;p&gt;Whatever the path, bear in mind that the biggest effort when dealing
  with maintenance is going to keep the scopes synchronized between
  Liferay and your authorization server to manage the permissions given
  to clients on the liferay headless CMS objects.&lt;/p&gt;
&lt;p&gt;If you were to use my current solution, please get back to me if you
  have any feedback. I'm not using in a real project yet.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Fabian&lt;/p&gt;</summary>
    <dc:creator>Fabian Bouché</dc:creator>
    <dc:date>2020-11-09T08:26:06Z</dc:date>
  </entry>
  <entry>
    <title>RE: Custom authentication for headless API</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120407721" />
    <author>
      <name>Carlos Sierra</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120407721</id>
    <updated>2020-11-06T14:32:54Z</updated>
    <published>2020-11-06T14:32:54Z</published>
    <summary type="html">&lt;p&gt;Hi Andrej,&lt;/p&gt;
&lt;p&gt;as Jack points out, the best way to do this is registering your own
  AuthVerifier to process and validate the incoming JWT token.&lt;/p&gt;
&lt;p&gt;There are a lot of different ways to process a JWT token and they can
  bear a lot of different information, not to mention encryption or
  signatures, that's the main reason you need to register a
  customization for this.&lt;/p&gt;
&lt;p&gt;We are tracking this &lt;a
    href="https://tools.ietf.org/html/rfc8693"&gt;proposed standard&lt;/a&gt; in
  our backlog to provide a more standard way of processing JWT in the
  future. Although it is possible that still some customizations would
  need to be applied we should expect a more straightforward integration
  with the OAuth2 layer.&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
&lt;p&gt;Carlos.&lt;/p&gt;</summary>
    <dc:creator>Carlos Sierra</dc:creator>
    <dc:date>2020-11-06T14:32:54Z</dc:date>
  </entry>
  <entry>
    <title>RE: Custom authentication for headless API</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120073698" />
    <author>
      <name>Jack Bakker</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120073698</id>
    <updated>2020-10-09T13:15:05Z</updated>
    <published>2020-10-09T13:15:05Z</published>
    <summary type="html">I need this too, and still need to devote time to try coding for it, perhaps with an AuthVerifier. I currently have an API gateway (Krakend) in front of Liferay which does the JWT validation against Keycloak. </summary>
    <dc:creator>Jack Bakker</dc:creator>
    <dc:date>2020-10-09T13:15:05Z</dc:date>
  </entry>
  <entry>
    <title>Custom authentication for headless API</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120065790" />
    <author>
      <name>Andrej Gregorka</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120065790</id>
    <updated>2020-11-09T17:25:06Z</updated>
    <published>2020-10-08T15:06:05Z</published>
    <summary type="html">How can I write a custom authentication plugin for headless API avaiable on /o/headless-delivery/..&lt;br /&gt;
According to documentation (&lt;a href="https://help.liferay.com/hc/en-us/articles/360039026192-Making-Authenticated-Requests"&gt;https://help.liferay.com/hc/en-us/articles/360039026192-Making-Authenticated-Requests&lt;/a&gt;
), its only possible to use Basic Auth, Oauth2, cookies.&lt;br /&gt;
I would like to login using external JWT token from Keycloak using
openidconnect protocol. I can set up Keycloak login on portal itself but
I see no way of using that for headless API.&lt;br /&gt;
I tried creating AutoLogin plugin, where I would validate the JWT token
provided in header, but I see that it does not even trigger when
accessing /o/headless-delivery/.. URL.How can I enable that or what is
the correct way to enable custom authentication for headless API. &lt;br /&gt;
Without being able to do this we can't use Liferay as CMS for our solution.</summary>
    <dc:creator>Andrej Gregorka</dc:creator>
    <dc:date>2020-10-08T15:06:05Z</dc:date>
  </entry>
</feed>
