I have the following problem: I have a frontend application A that authenticates, sets up a reverse proxy, and then forwards to a separate application B I don't control.
I would like to add decorations to the resulting page of the B application, for example adding a button "logout", but I can't modify B's code or templates.
Is there some magic trick I don't know about to obtain this result?
Your case, as discussed in the comments, leaves you open for a couple options:
Load application b inside an
<iframe>, while keeping a custom navigation bar in the top on a fixed position. This would be possible if the
<iframe> is hosted on the same location as application b. This would avoid tampering with the original code of application b, while still giving you freedom to alter the user experience.
<iframe src="https://mdn-samples.mozilla.org/snippets/html/iframe-simple-contents.html" width="400" height="300">
<p>Your browser does not support iframes.</p>
(variation on this):
<object data="http://www.web-source.net" width="600" height="400"> <embed src="http://www.web-source.net" width="600" height="400"> </embed> Error: Embedded data could not be displayed. </object>
Alternatively, this is a great related question with some viable solutions: Alternative to iFrames with HTML5
It's an option, but you shouldn't if you're not comfortable to edit it. Because you'll most likely waste a lot of time on it.
Good luck with your application!