2FAuth – OAuth keys regenerated on every app restart, invalidating browser extension tokens
-
Hello Cloudron Support Team,
I would like to report what appears to be a packaging issue with the 2FAuth application on Cloudron.
For several weeks, I have been experiencing recurring authentication failures with the 2FAuth browser extensions on multiple computers, affecting both Chrome and Firefox.
Every two to three days, the extensions stop working and require complete reconfiguration, including generating new access tokens.
After investigating the application logs and startup scripts, I believe I have identified the likely cause.1. Authentication failures
The application logs show repeated HTTP 401 Unauthorized responses on API endpoints, including:
GET /api/v1/features 401
GET /api/v1/groups 401
GET /api/v1/twofaccounts 401
GET /api/v1/user/preferences 401Laravel Passport also reports:
League\OAuth2\Server\Exception
OAuthServerExceptionThe resource owner or authorization
server denied the request.2. OAuth key modification after an update
Both OAuth key files were modified on November 21, 2026, at approximately 22:00 UTC, coinciding with the latest Cloudron application update.
The files are correctly stored in the persistent directory /app/data/storage/, and /app/code/storage/ points to the same files.3. Suspected issue in the Cloudron startup script
While inspecting /app/pkg/start.sh, I found the following command in the upgrade branch:
echo "no" | gosu www-data:www-data \ php artisan passport:install --forceThis branch is selected whenever the database already contains tables, meaning it appears to run on normal application restarts as well as upgrades.
As far as I understand, Laravel Passport's passport:install --force regenerates the OAuth signing keys, potentially invalidating previously issued access tokens.
The echo "no" response does not appear to prevent key regeneration.
This would explain why all browser extensions lose their authentication simultaneously after application updates or restarts.4. Suggested correction
Could you please review whether passport:install --force is necessary on every startup of an existing installation?
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.
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.
Would you be able to investigate and confirm whether this behavior is expected?Thank you for your work on Cloudron and for your assistance.
Best regards.
-
-
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login