Node-RED adminAuth and httpNodeAuth credentials lack native expiry or revocation
0 reputation · 06 Oct 2020, 18:22 UTC
0 reputation · 06 Oct 2020, 18:22 UTC
Goal: Run Node-RED with one least-privilege authentication model across the editor, admin API, and HTTP-in endpoints, and apply credential or token changes without restarting the runtime.
Node-RED secures the editor and admin API through adminAuth, while httpNodeAuth independently guards HTTP-in endpoints. An editor session does not automatically satisfy httpNodeAuth. Tokens under adminAuth.tokens rely on a static secret with no native per-token TTL or revocation. Changing hashes or the token secret in settings.js requires a restart, and the core runtime lacks role-based access control for individual flows or nodes.
Behavior may differ between Node-RED 1.x, 2.x, and 3.x; confirm the installed version before assuming how expiry, revocation, or cross-endpoint authorization works.
Node-RED does not natively support a unified credential store between the editor and HTTP endpoints, nor does it provide granular token revocation or role-based access control (RBAC) for individual flows.
adminAuth (Editor/API) and httpNodeAuth (HTTP-in nodes) operate as independent mechanisms. Authenticating into the editor does not grant access to endpoints protected by httpNodeAuth.adminAuth token without changing the global secret in settings.js, which invalidates all active sessions and requires a runtime restart.The adminAuth system relies on a static secret to sign tokens. Because these tokens are stateless and the secret is loaded at startup, the runtime cannot "blacklist" a specific token without changing the key used to validate all tokens. Similarly, httpNodeAuth is a middleware layer specifically for the HTTP-in node, separate from the session management used by the admin editor.
To achieve least-privilege access, token expiry, and unified authentication without restarting the runtime, move the authentication boundary outside of Node-RED using a reverse proxy (e.g., NGINX, Traefik, or OAuth2 Proxy).
adminAuth and httpNodeAuth from settings.js./) and the API/HTTP endpoints (/api or custom paths).To confirm the current behavior in your environment (applicable to versions 1.x through 3.x):
http-in node protected by httpNodeAuth. You should be prompted for credentials again, confirming the lack of shared state.settings.js and attempt to access the editor. The change will not take effect until the Node-RED process is restarted.Diagnostic Note: Please specify if you are using a managed Node-RED distribution (e.g., FlowForge/FlowFuse), as these platforms provide an external management layer that overrides these core runtime limitations.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.