Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Offical apps | Community apps | Demo | Docs | Install
  1. Cloudron Forum
  2. 2FAuth
  3. 2FAuth – OAuth keys regenerated on every app restart, invalidating browser extension tokens

2FAuth – OAuth keys regenerated on every app restart, invalidating browser extension tokens

Scheduled Pinned Locked Moved 2FAuth
4 Posts 3 Posters 58 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S
    S
    SpartanSpark
    wrote last edited by
    #1

    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 401

    Laravel Passport also reports:

    League\OAuth2\Server\Exception
    OAuthServerException

    The 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 --force
    

    This 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.

    1 Reply Last reply
    2
    • jamesJ
      jamesJ
      james
      Staff
      wrote last edited by
      #2

      Hello @spartanspark and welcome to the Cloudron community forum

      Thanks for the report.

      1 Reply Last reply
      1
      • girishG
        girishG
        girish
        Staff
        wrote last edited by girish
        #3

        Should be fixed in the latest package. Thanks for reporting @spartanspark

        1 Reply Last reply
        1
        • S
          S
          SpartanSpark
          wrote last edited by
          #4

          Hello @james @girish thank you so much!!

          1 Reply Last reply
          1

          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
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Bookmarks
          • Search