crkn-rcdr / sapindale

Sapper/Svelte access platform administration interface
2 stars 2 forks source link

Have auth fetch a new token when required #6

Closed SaschaAdler closed 3 years ago

SaschaAdler commented 5 years ago

This can work one of two ways:

  1. Set an interval after fetching the auth token, which triggers a new fetch
  2. When an authorized request fails, trigger a new fetch

The second option seems more complicated, but allows for sapindale to not guess at the length the interval before fetching a new token should be.

Of course, if amsa requires a new login, the new fetch will fail, and this will have to be handled effectively.

RussellMcOrmond commented 5 years ago

I have observed Swift giving a 401 within the time period already. Seems that there are a variety of reasons why Swift will request authentication, so assuming it is based in time will periodically fail.

RussellMcOrmond commented 4 years ago

Will the sapindale tools do this on the client side when interacting with Couch via Upholstery? I'm wondering if it is worth having the error page output something other than the "JWT authenication failure" (Yes, spelling mistake :-) page which may be useful for developers, but not for any regular humans that might see it.

RussellMcOrmond commented 4 years ago

An FYI that when trying to do a large request with https://admin-demo.canadiana.ca/archivalmanifest that the adding of new requests stopped when the token expired. Having the token auto-renew would be great!

https://crkn-rcdr.slack.com/archives/CAXMM3JTW/p1591390327147200