I have secured static resources (css, js, png, htmls, ...) I use basic authentication. The user can't get anything unless he is authenticated.
My question : is there any way to create a form and use javascript to set the value of basic auth for the browser ?
Where does the browser store this header (Authorization = Basic username:password) ?
Something like :
$ajax({
'beforeSend': function(xhr) {
xhr.setRequestHeader("Authorization", "Basic " + btoa($("#user").val() + ":" + $("#pass").val()))
}
)}
works for ajax calls but not for static resources requests !!