How can i open a url in web browser (such as IE) and pass credentials

前端 未结 5 1077
傲寒
傲寒 2020-12-09 10:15

I want to open a page that required Basic authentication. I want to pass the Basic authentication header to the browser along with the URL.

How can i do that?

5条回答
  •  情书的邮戳
    2020-12-09 10:58

    You could try the old "in URL" format which allowed this but it is insecure:

    http(s)://username:password@server/resource.ext
    

    This exposes credentials and IE has disabled it, but it may still work in other browsers. When this format is used the credentials are available to the browser and it makes the decision to send the basic authentication header depending on how the web server responds.

提交回复
热议问题