Closed matthewadams closed 1 year ago
I really don't want to encourage anyone to turn off 2FA. I wonder if we can do something to make it easier to get the auth token though.
A couple of things here:
This issue in general raises the question: how often does the token expire? If I manually get the token from the chrome dev tools, based on the readme instructions, how long is that token good for before I have to do that again and put a new token in the config?
As far as not wanting to disable 2fa, can a valid token (before it expires) be used to get a new token? If so, go that route. Authenticate with the existing token every xx days or whatever before the expiration, grab the new token, replace it in the config. So, you would only need to do get the token manually the first time (or if you don't renew it in time).
I've been running https://github.com/dbrand666/DataRemaining for close to a year and have rarely had to update the token. Maybe twice? Once was after changing my password so it doesn't really count.
Make sure you generate the token in a private window. Logging out accidentally, which might happen in your main session, will certainly invalidate the token.
I guess I'm saying token expiration hasn't been an issue for me so I haven't put the time into it. I would like to make the setup simpler though.
Ok. It just got me while I was on vacation. It's time to do something about it.
Add
username
&password
as config values, then get a new JWT from endpointPOST /web-gateway/api/v1/auth
with JSON body{"username":"blah","password":"blargy"}
whenever the configuredtoken
is either blank or has expired. The returned payload is JSON of the form{"jwtToken":"ey..."}
.