Login Form For Http Basic Auth

前端 未结 4 692
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-17 14:53

I am running a Perl application named bitlfu.For login it is using something like Apache HTTP Basic Auth but not a form.I want to make form

4条回答
  •  悲哀的现实
    2020-12-17 15:31

    The method of explicitly redirecting document.location with username@password in URL caused me some problems with Safari giving a phishing warning.

    If I instead first make an AJAX request to a URL with basic auth headers added, and then redirect document.location without the username/pass in the URL then it worked better for me

    Example

    
    
    
    
    
    
    Username: Password:

    Unfortunate caveat with Safari only, if you type your username and password incorrectly, then it makes another standard HTTP basic auth popup, but this is better than a big red "Phishing warning" that occurs when you make the document.location include username/pass

    Chrome doesn't have duplicate popup if login credentials are incorrect though

提交回复
热议问题