<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[2FAuth – OAuth keys regenerated on every app restart, invalidating browser extension tokens]]></title><description><![CDATA[<p dir="auto">Hello Cloudron Support Team,</p>
<p dir="auto">I would like to report what appears to be a packaging issue with the 2FAuth application on Cloudron.<br />
For several weeks, I have been experiencing recurring authentication failures with the 2FAuth browser extensions on multiple computers, affecting both Chrome and Firefox.<br />
Every two to three days, the extensions stop working and require complete reconfiguration, including generating new access tokens.<br />
After investigating the application logs and startup scripts, I believe I have identified the likely cause.</p>
<h3>1. Authentication failures</h3>
<p dir="auto">The application logs show repeated HTTP 401 Unauthorized responses on API endpoints, including:</p>
<p dir="auto"><strong>GET /api/v1/features          401<br />
GET /api/v1/groups            401<br />
GET /api/v1/twofaccounts      401<br />
GET /api/v1/user/preferences  401</strong></p>
<p dir="auto">Laravel Passport also reports:</p>
<p dir="auto"><strong>League\OAuth2\Server\Exception<br />
OAuthServerException</strong></p>
<p dir="auto">The resource owner or authorization<br />
server denied the request.</p>
<h3>2. OAuth key modification after an update</h3>
<p dir="auto">Both OAuth key files were modified on November 21, 2026, at approximately 22:00 UTC, coinciding with the latest Cloudron application update.<br />
The files are correctly stored in the persistent directory <strong>/app/data/storage/, and /app/code/storage/</strong> points to the same files.</p>
<h3>3. Suspected issue in the Cloudron startup script</h3>
<p dir="auto">While inspecting /app/pkg/start.sh, I found the following command in the upgrade branch:</p>
<pre><code>echo "no" | gosu www-data:www-data \
  php artisan passport:install --force
</code></pre>
<p dir="auto">This branch is selected whenever the database already contains tables, meaning it appears to run on normal application restarts as well as upgrades.<br />
As far as I understand, Laravel Passport's <strong>passport:install --force</strong> regenerates the OAuth signing keys, potentially invalidating previously issued access tokens.<br />
The echo "no" response does not appear to prevent key regeneration.<br />
This would explain why all browser extensions lose their authentication simultaneously after application updates or restarts.</p>
<h3>4. Suggested correction</h3>
<p dir="auto">Could you please review whether passport:install --force is necessary on every startup of an existing installation?<br />
It seems that OAuth keys should only be generated during initial installation, or when genuinely missing, while preserving existing keys during subsequent restarts and upgrades.<br />
I have not yet performed a before-and-after key fingerprint comparison, but the startup script, key modification timestamps, and authentication failures strongly suggest this is the root cause.<br />
Would you be able to investigate and confirm whether this behavior is expected?</p>
<p dir="auto">Thank you for your work on Cloudron and for your assistance.</p>
<p dir="auto">Best regards.</p>
]]></description><link>https://forum.cloudron.io/topic/16327/2fauth-oauth-keys-regenerated-on-every-app-restart-invalidating-browser-extension-tokens</link><generator>RSS for Node</generator><lastBuildDate>Tue, 24 Nov 2026 05:00:54 GMT</lastBuildDate><atom:link href="https://forum.cloudron.io/topic/16327.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 22 Nov 2026 19:22:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 2FAuth – OAuth keys regenerated on every app restart, invalidating browser extension tokens on Mon, 23 Nov 2026 20:39:48 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/james" aria-label="Profile: james">@<bdi>james</bdi></a> <a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> thank you so much!!</p>
]]></description><link>https://forum.cloudron.io/post/133320</link><guid isPermaLink="true">https://forum.cloudron.io/post/133320</guid><dc:creator><![CDATA[SpartanSpark]]></dc:creator><pubDate>Mon, 23 Nov 2026 20:39:48 GMT</pubDate></item><item><title><![CDATA[Reply to 2FAuth – OAuth keys regenerated on every app restart, invalidating browser extension tokens on Mon, 23 Nov 2026 20:37:48 GMT]]></title><description><![CDATA[<p dir="auto">Should be fixed in the latest package. Thanks for reporting <a class="plugin-mentions-user plugin-mentions-a" href="/user/spartanspark" aria-label="Profile: spartanspark">@<bdi>spartanspark</bdi></a></p>
]]></description><link>https://forum.cloudron.io/post/133319</link><guid isPermaLink="true">https://forum.cloudron.io/post/133319</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Mon, 23 Nov 2026 20:37:48 GMT</pubDate></item><item><title><![CDATA[Reply to 2FAuth – OAuth keys regenerated on every app restart, invalidating browser extension tokens on Sun, 22 Nov 2026 22:08:43 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/spartanspark" aria-label="Profile: spartanspark">@<bdi>spartanspark</bdi></a> and welcome to the Cloudron community forum</p>
<p dir="auto">Thanks for the report.</p>
]]></description><link>https://forum.cloudron.io/post/133286</link><guid isPermaLink="true">https://forum.cloudron.io/post/133286</guid><dc:creator><![CDATA[james]]></dc:creator><pubDate>Sun, 22 Nov 2026 22:08:43 GMT</pubDate></item></channel></rss>