Question

In my project my client side web application calls my back-end server which is a restful API sercured with HTTP baisc authentication, it runs perfect in chrome and firefox, but within the safari it always shows the HTTP basic login form, how could I prevent it to pop up in the client side.

And the client side app validates user login by calling the restful api and returns 401 automatically at the begining.

enter image description here

No correct solution

OTHER TIPS

See an analysis of the problem here.

We had the same problem only with a recent Safari version (all other versions were fine), and the cleanest fix was to modify the "www-authenticate" header so that it doesn't return a Basic or Digest challenge.

Thus, the API url will never trigger the popup (whether it's called via Ajax or directly). Up to you to decide whether it's okay for your use case.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top