I have a simple user-registration website where I keep records of registered users. I also have an admin page to upload videos, however videos are uploaded to a different server.
I'm using the <video>
tag to show the video:
<video width="560" height="340" controls>
<source src="path/to/myvideo.mp4" type="video/mp4";>
</video>`
I want to show this video only to my registered users on my website, since the video is on second server, how can I protect it?
I thought I could build an application and install it on second server, this app will watch whether the requested url is for videos, if so then it'll redirect the user to my login page and here he'll be authenticated and again redirected to the same video url.
Is this a workable plan? How else could I approach this?