apache - Can AJAX submit credentials for Basic Authentication? -


this might little bit of stretch, let's assume need work way:

  • i have index.html file in web root of server. javascript in file needs make ajax request /secure/ajax.php
  • everything in /secure/ directory protected using basic authentication
  • i don't want bother user logging in /secure/ section

can submit credentials basic authentication ajax request?

xmlhttprequest.setrequestheader friend.

xhr.setrequestheader("authentication", "username:password in base64") 

you need convert username:password base64


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -