I have a data stream that ingests data then saves the new data every 10 seconds to a specific resource. This seems to work until a certain point at which all saves and gets to the resource return a 401 error until I kill the process and restart it. The server is ESS. Does anyone have an idea about this?
401 like this would absolutely imply your session has expired, you’d have to share some code. If you’re using @inrupt/solid-client-authn-node, then periodically the session will emit an event refresh token event, and then the session needs to be updated, it’s kind of documented here: Authenticate (Node.js: Single-User App) — Inrupt JavaScript Client Libraries
But, if your script is only updating periodically, creating a session when you do the update, rather than holding the session open may be better.
I see what you mean - however how do I retrieve the initial refresh token in nodejs using the Inrupt libraries? I didn’t see an example for it unless I missed it.
I see. I believe I am using static access as there is no mention or instance of a refresh token for authorization. After some number of saves or time, my next save is met with a 401 Unauthorized error. Is there a time/push limit for static access?
Am I correct that if one logs in with a provider whose access token is longer, one can can use that instead? For example, if, on my ESS pod, I give all rights to my solidcommunity.net WebID and then login at solidcommunity.net, I will have a longer timeout when visiting ESS?
[EDIT] … or would the longer timeout only apply to the user, but not to the app?
Thank you. Is there perhaps a code sample in js/ts to get the initial refresh token? I understand the onNewRefreshToken callback, but retrieving the initial refresh token was not demonstrated to my knowledge.