Is it possible to set the Basic Authentication username and password from a server response?
I have a site http://www.example.com where you can log in with any given cookie auth system.
The site also has a app at a different url served by a different server, say http://www.example.com/other. The app served by the other url is not mainted by me and I dont want to try and edit it to add a password system.
I want to secure that directory with basic auth, and then have my main site set the basic auth when they visit http://www.example.com before going onto the other url.
Or is there a better way to do this?
*Edit More Info:
http://www.example.com is served by a flask app using mod_wsgi
http://www.example.com/other is a awstats (php) app served via Apache,
The flask app has a cookie based auth system, which I would like to extend to the awstats app.
This is not possible if you actually want to hand the user off from one web app server to another, as the basic authentication credentials will always need to be provided by the client when connecting to the server in use.
You could perhaps use cURL or similar to get content from the second server on behalf of the user and display it within the web application on the first server. Or you could configure your server as a proxy perhaps, but if you actually want the request to be fulfilled directly between the client and the second server, you are going to need to look into a different authentication mechanism – perhaps something like OAuth.