Mehdiway Mehdiway - 1 month ago 8
HTML Question

Javascript - Using with Basic Authentication

When the user logs into my app, he can click on a button to download a CSV file from the server. This URL for the download is protected using basic authentication. When I do this :'http://url-of-the-csv-file');

The browser shows a username/password popup (Basic Authentication)

I want to be able to open the URL without asking the user to enter his password a second time. How do I do that ?

myf myf

If you know basicAuth credentials of your looged-in user, you could fill in them in the URL:


If your app is in open web, do it ONLY if the target is on HTTPS, because such request including credentials will be readable for anyone eavesdropping your wires. This also applies to the other (javascript) answer.