Replies: 1 comment
-
@bchah What is that site? It looks really cool. Can I log in and take a look? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I wanted to share this concept with the community as I have spent some time implementing it in my own application and it might solve some issues for those of you looking for better abilities to revoke access to a stream. This assumes you've got some kind of web front-end with a means of public link access, and some kind of database on the back-end.
The Problem:
Currently it is possible to use SignedPolicy to set time limits on how long a stream can be watched or how long the URL is valid to start watching. This is useful but if you issue a stream URL with a generous policy there is no built-in way to revoke that access.
Admission WebHooks are another useful means of access control but the same problem exists - once admission has been granted, it cannot be revoked until you restart OME or stop the stream.
The Solution:
Introduce a secondary, public key that is associated with each stream. You might already be using something like this for a public link, where a user who is not logged into your application can exchange the public key for a signed stream URL that allows them to playback.
With this secondary public key in place, your application simply needs to ask itself “has this key changed?” i.e. when a stream operator resets the public link/key for a particular stream, the value of that key in the database will change. Checking every 10 seconds in the form of a ‘Heartbeat’ has turned out to be very effective in my application.
Here is a bit of an example from my application. A JS function that calls a PHP backend to check the key, and if it is no longer valid it calls another function to ‘expire’ the player and direct the user to another page.
Frontend:
Backend:
The effect on the user side is a graceful departure from the player as seen below. This could be made much more secure if you are using something like NodeJS to draw to the page, or if you echo a new location header from PHP to take them off the page entirely.
I hope this concept sparks an idea and helps somebody out there in the OME community. As always thank you to Airensoft for making OME available to us.
Heartbeat.mp4
Beta Was this translation helpful? Give feedback.
All reactions