<?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 Refresh Token with PKCE Flow</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120728773" />
  <subtitle>Headless Delivery Refresh Token with PKCE Flow</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120728773</id>
  <updated>2026-04-04T07:55:37Z</updated>
  <dc:date>2026-04-04T07:55:37Z</dc:date>
  <entry>
    <title>RE: Headless Delivery Refresh Token with PKCE Flow</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120735666" />
    <author>
      <name>Tomáš Polešovský</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120735666</id>
    <updated>2021-04-20T17:54:57Z</updated>
    <published>2021-04-20T17:54:57Z</published>
    <summary type="html">&lt;blockquote&gt;
  &lt;p&gt;but when using the Authorization with PKCE, there is no
    client_secret, so this request will not work. &lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;It works for me.&lt;/p&gt;
&lt;p&gt;
  &lt;code&gt;curl 'http://localhost:8080/o/oauth2/token' \&lt;br /&gt;  -H
    'Content-Type: application/x-www-form-urlencoded' \&lt;br /&gt;  --data
    'client_id=my-pkce-client' \&lt;br /&gt;  --data
    'grant_type=refresh_token' \&lt;br /&gt;  --data
    'refresh_token=bfc9878164882767b19a9fa29b13ecc6f1c9c124a68d426158ec4bb3e7d'
    \&lt;br /&gt;  --compressed&lt;br /&gt; &lt;/code&gt;&lt;/p&gt;</summary>
    <dc:creator>Tomáš Polešovský</dc:creator>
    <dc:date>2021-04-20T17:54:57Z</dc:date>
  </entry>
  <entry>
    <title>RE: RE: Headless Delivery Refresh Token with PKCE Flow</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120737253" />
    <author>
      <name>Stephen Greco</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120737253</id>
    <updated>2021-04-19T10:27:50Z</updated>
    <published>2021-04-19T10:27:50Z</published>
    <summary type="html">&lt;p&gt;Thats for the response Javier.  This request does work for me when
  using the standard Authorization Code flow, but when using the
  Authorization with PKCE, there is no client_secret, so this request
  will not work. &lt;/p&gt;
&lt;p&gt;I did base my other attempts off of this and tried many different
  combinations, and I keep getting the unauthorized_client error but no
  other details.  Instead of the client_secret the PKCE flow utiliizes
  the code verifier and code challenge to obtain the first token, I have
  tried to send those appropriate values as well with no success.&lt;/p&gt;</summary>
    <dc:creator>Stephen Greco</dc:creator>
    <dc:date>2021-04-19T10:27:50Z</dc:date>
  </entry>
  <entry>
    <title>RE: Headless Delivery Refresh Token with PKCE Flow</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120736817" />
    <author>
      <name>Javier Gamarra</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120736817</id>
    <updated>2021-04-17T21:14:54Z</updated>
    <published>2021-04-17T21:14:54Z</published>
    <summary type="html">&lt;p&gt;Hi! &lt;/p&gt;
&lt;p&gt;I'm not an expert on OAuth (maybe the security team can chime in on this)...&lt;/p&gt;
&lt;p&gt;Can you paste the request you are trying? I've tried to refresh a
  token (but with another flow) with a request like this and I get a new
  valid access token:&lt;/p&gt;
&lt;p&gt;
  &lt;br /&gt;curl -X &amp;quot;POST&amp;quot;
  &amp;quot;http://localhost:8080/o/oauth2/token&amp;quot; \&lt;br /&gt;     -H
  'Content-Type: application/x-www-form-urlencoded; charset=utf-8'
  \&lt;br /&gt;     --data-urlencode
  &amp;quot;client_id=id-64eaf18c-49bb-6c9c-7b9a-84f17f65d21&amp;quot; \&lt;br /&gt; 
     --data-urlencode
  &amp;quot;client_secret=secret-98fecb7d-3421-78e4-bca5-955b08f7f58&amp;quot;
  \&lt;br /&gt;     --data-urlencode &amp;quot;grant_type=refresh_token&amp;quot;
  \&lt;br /&gt;     --data-urlencode
  &amp;quot;redirect_uri=http://localhost:8080/&amp;quot; \&lt;br /&gt;   
   --data-urlencode &amp;quot;refresh_token=2f485f80a58f3bb3e964ddbbe3da71561d1f459a75a1ec58365bd39a3762c9d&amp;quot;&lt;br /&gt; &lt;/p&gt;</summary>
    <dc:creator>Javier Gamarra</dc:creator>
    <dc:date>2021-04-17T21:14:54Z</dc:date>
  </entry>
  <entry>
    <title>Headless Delivery Refresh Token with PKCE Flow</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120728772" />
    <author>
      <name>Stephen Greco</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120728772</id>
    <updated>2021-04-15T11:46:39Z</updated>
    <published>2021-04-15T11:46:39Z</published>
    <summary type="html">&lt;p&gt;I am struggling to obtain refresh tokens wihen using the
  headess-delivery with the PKCE OAuth 2.0 Flow.  There doesnt seem to
  be any documentation on how to obtain a new token using the refresh
  token.  The PKCE flow is wokring fine for obtaining the original token
  but when I request a new token using the refresh_token, it is
  returning an error 'unauthorized client'.  I am simply looking for
  some sort of example or documentation on how to do this.&lt;/p&gt;</summary>
    <dc:creator>Stephen Greco</dc:creator>
    <dc:date>2021-04-15T11:46:39Z</dc:date>
  </entry>
</feed>
