I administer website A that provides information for a number of users. Website B is an external website containing information that I would like to provide to the users of site A. Login credentials via basic HTTP authentication are required to access B. As the users of A do not know these login credentials, I am searching for a way to have the server of A (which I have full access to) acting like some sort of proxy between the users of site A and site B itself.
Here's how I imagine the sequence of actions:
- User X clicks a link on A, a new browser window (or tab) opens
- Server A logs in to B
- B is mirrored to the new tab on X's browser
- X is now seeing B as if he had logged in himself
- When X clicks a link on B, the HTTP request is not directly handled by B, instead A forwards the request to B and B's reply to X
The main goal is to enable the users to access B without having to know the login credentials. A nice extra would be if B would only see A's IP, not the user's IP.
Because information on B changes frequently, using a method similar to creating a snapshot of B that is hosted on A won't work even if that snapshot is created in regular intervals.
Edit:
I have no access to B except for the frontend, thus I cannot change anything there. Information is indeed protected for a reason, but we are allowed to access this information. The problem is that some of my users seem to share the login credentials with their friends etc., so that's what I am trying to avoid.
Server A is running Apache with PHP 7.3.
I am no professional coder but having a basic understanding of how things work, so far I've been mostly able to help myself by reading the documentation. Therefore, a simple solution is not necessarily the main goal.
Edit 2:
I also have the option to set up a small server on our premises running a proxy (or anything else needed). However it will not be part of the internal network of neither A or B.