Add refresh token support for Docker mode authentication#375
Merged
Edwardvaneechoud merged 4 commits intomainfrom Mar 30, 2026
Merged
Add refresh token support for Docker mode authentication#375Edwardvaneechoud merged 4 commits intomainfrom
Edwardvaneechoud merged 4 commits intomainfrom
Conversation
Users in Docker mode had to re-login every ~1 hour when the access token expired. This adds a refresh token mechanism (7-day JWT) so the frontend can silently obtain new access tokens without requiring re-login. Backend changes: - Add refresh_token field to Token response model - Issue refresh tokens alongside access tokens on Docker login - Add POST /auth/refresh endpoint for token rotation - Add type claim to JWTs to distinguish access vs refresh tokens - Reject refresh tokens used as Bearer tokens for API auth - Fix ACCESS_TOKEN_EXPIRE_MINUTES import (was 60 in jwt.py, 120 in settings.py) Frontend changes: - Store refresh token in localStorage on login - Attempt silent refresh on 401 before redirecting to login page - Proactively refresh access tokens expiring within 5 minutes - Clear refresh tokens on logout https://claude.ai/code/session_018c9637emA3RsjJhg9aLUz6
✅ Deploy Preview for flowfile-wasm canceled.
|
✅ Deploy Preview for flowfile-wasm canceled.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements refresh token functionality to enable long-lived sessions in Docker mode while maintaining security through short-lived access tokens. This allows users to remain logged in without re-entering credentials when their access token expires.
Key Changes
Backend (flowfile_core):
create_refresh_token()anddecode_refresh_token()functions to handle refresh token generation and validation/auth/refreshendpoint that exchanges a valid refresh token for new access and refresh tokensACCESS_TOKEN_EXPIRE_MINUTESto settings and addedREFRESH_TOKEN_EXPIRE_DAYSconstant (7 days)Frontend (flowfile_frontend):
AuthResponseinterface to include optionalrefresh_tokenfieldrefreshAccessToken()method to exchange refresh tokens for new access tokensImplementation Details
/auth/refreshendpoint"type": "access"claim; refresh tokens include"type": "refresh"to prevent token type confusion attacks