UpUp icon indicating copy to clipboard operation
UpUp copied to clipboard

Using UpUp with an .htaccess authentification

Open LrntL opened this issue 5 years ago • 3 comments

Hi,

My current website is still under development. So I use an .htaccess authentication to restrict the access. Unfortunately, UpUp doesn't handle .htaccess authentication and accessing the site provide an 401 error.

After some reseach, some people (not using UpUp but hand made service worker) resolve this by using {'credentials': 'same-origin'} in fetch(), add() or addAll() methods. (See https://stackoverflow.com/a/47492920)

I change line 62 in upup.sw.js from : return new Request(urlToPrefetch, { mode: 'no-cors' });

to: return new Request(urlToPrefetch, { mode: 'no-cors', credentials: 'same-origin' });

And after clearing the cache, it seems to work. If this is the correct way to make UpUp working with .htaccess authentication, maybe this option could be added in the code.

Let me know if this sounds interesting Cheers. Laurent.

  • Version used: 1.1.0
  • Browser Name and version: Chrome Version 75.0.3770.80 (Build officiel) (64 bits)
  • Operating System and version (desktop or mobile): Windows 10 Pro

LrntL avatar Jun 10 '19 07:06 LrntL

In fact, after checking, it is still not working... Seems to work with a homemade srvice worker but not with UpUp.

Any idea about using UpUp with htaccess auth ?

LrntL avatar Jun 11 '19 06:06 LrntL

It should work in Chrome 77 which adds Service workers support basic HTTP authentication.

moneytoo avatar Jul 27 '19 16:07 moneytoo

Still not working. Got a blank page at first load with Chrome Version 79.0.3945.79 ((64 bits)

LrntL avatar Dec 17 '19 08:12 LrntL