Reputation: 1
I enabled user authentication on Node Red. but when I restart the service the user is still logged in
I have done some searches. there is some suggestions around changing the machine key every time the service restarts.
does anyone have any suggestions about what exactly should I do ?
Upvotes: 0
Views: 408
Reputation: 59731
As mentioned in the docs on securing Node-RED the authentication tokens generated last for 7 days.
You can change this by editing the settings.js
file
The expiration time can be customised by setting the sessionExpiryTime property of the adminAuth setting. This defines, in seconds, how long a token is valid for. For example, to set the tokens to expire after 1 day:
adminAuth: { sessionExpiryTime: 86400, ... }
EDIT:
The session tokens on the backend are (when using the default storage plugin) stored in a file called .sessions.json
in the userDir (as logged on startup). If you want to log out all users on a restart then you will need to delete this file before starting Node-RED.
Upvotes: 2