I have the following problem: I want to access a picutre (Motion Stream on Raspberry Pi) which is secured by http authentication.
To don't show the password in plain html code, I use this in html:
<img src="/image"/>
And process the request on my Spring Boot server, so this function in my WebController class redirects the request to the real location of the image:
@RequestMapping("/image")
public RedirectView image() {
RedirectView redirectView = new RedirectView();
redirectView.setUrl("http://user:password@server:port/");
return redirectView;
}
This method works fine in Firefox, but I can't access the image in Chromium unless I enter the login data in a new tab by accessing the server myself. How can I create a working and even safer method for all browsers, on backend with Java & Spring or frontend with html & Javascript?
Thanks for your help!