开发者

Redirect to a page that uses basic authentication

开发者 https://www.devze.com 2022-12-24 17:32 出处:网络
I\'m trying to redirect to a page that uses basic authentication, with no success so far. Most examples I found online where to either use fopen or curl to request a resource, which I don\'t want to d

I'm trying to redirect to a page that uses basic authentication, with no success so far. Most examples I found online where to either use fopen or curl to request a resource, which I don't want to do.

I've 开发者_开发技巧tried putting in the header the "Authorization: Basic" plus the encoded user:password, but it didn't work. Is it because I first need to receive a request from the other page for the authorization credentials?


No. It's because it's just impossible. You send these headers to the browser, and browser don't know what to do with it.

Direct request feature (using login:pass@ notation) was removed, due to excessive phishing usage.

So, do just usual redirect and then let user to enter their password.

0

上一篇:

:下一篇

精彩评论

暂无评论...
验证码 换一张
取 消