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.
精彩评论