Unable to fetch iOS webapp files on manifest update. 401 unauthorized

By | July 12, 2018
Questions:

I have a HTML5 webapp which is running perfectly when served via the IIS without authentication.

Is is using a cache.manifest file.

Both when running in safari, and as an “add to homescreen” fullscreen app, once I update the manifest file on the server, and the app will update.

When I turn on authentication on all files except the cache.manifest, then I only see the update when running it in the safari browser.

If I add it to the homescreen, I am not able to make the app update the cache.

If I wireshark the traffic on the server, I can see the manifest file is fetched without problems, but all the files in the manifest file hits a 401 Unautorized error.

Any idea how I can fix this? Running it in the safari browser is working..

Any help is highly appreciated.

Answers:

Safari is much more aware of HTTP Basic Auth, but web.app (the home screen web app handler, which is basically a UIWebView wrapper) isn’t as full-featured and doesn’t appear to support basic auth.

It seems you may need to work around this with either a server-side solution to append an authentication key to the filename (such as application.css?longhexkey) to bypass basic auth, or go with a more traditional login form (which may require significant changes to your app)

Same issue on Sencha forums: Unanswered: Forcing re-authentication after offline usage on iOS devices?

Leave a Reply

Your email address will not be published. Required fields are marked *