Jump to content
  • 0

Relationship between token and webrtc viewer id


Balazs
 Share

Question

Hi,

I am trying to work out how to connect the concept of a one-time token that I generate and hand out to a particular user with the "viewerId" that is mentioned in the REST API documentation, which seems to be the primary identifier of a player when I list players using https://antmedia.io/rest/#/BroadcastRestService/getWebRTCViewerList

My goal is to stop the playback for a client that I pick based on the token I gave out, but I don't understand how can I identify and stop a player in my server side plugin based on a token. Tokens get removed once used form the internal token map and I can't tell what was the generated viewer id, as it seems to be generated randomly.

I am using Ant Media Server 2.5.3 at the moment and my interface to AMS is the Java API / the available Spring Beans and not the REST API.

Thanks for any help!

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 1

I got a hint from @Burak that the viewerId is the same thing as subscriberId, this is not clear from the docs, but means that certain REST API calls that are talking about subscribers might be used here too - I'll check

  • Thanks 1
Link to comment
Share on other sites

  • 0
20 hours ago, Balazs said:

Hi,

I am trying to work out how to connect the concept of a one-time token that I generate and hand out to a particular user with the "viewerId" that is mentioned in the REST API documentation, which seems to be the primary identifier of a player when I list players using https://antmedia.io/rest/#/BroadcastRestService/getWebRTCViewerList

My goal is to stop the playback for a client that I pick based on the token I gave out, but I don't understand how can I identify and stop a player in my server side plugin based on a token. Tokens get removed once used form the internal token map and I can't tell what was the generated viewer id, as it seems to be generated randomly.

I am using Ant Media Server 2.5.3 at the moment and my interface to AMS is the Java API / the available Spring Beans and not the REST API.

Thanks for any help!

I believe you need to create a custom stream security implementation similar to existing ones. In that when client connects you can push the token to a custom database. Each time playback is requested check token validity from database and only then allow playback. I guess the java api examples are not quite there to help with this.

Link to comment
Share on other sites

  • 0
3 hours ago, Connessione said:

I believe you need to create a custom stream security implementation similar to existing ones. In that when client connects you can push the token to a custom database. Each time playback is requested check token validity from database and only then allow playback. I guess the java api examples are not quite there to help with this.

Or more importantly not sufficient examples on server side stuff.

Link to comment
Share on other sites

 Share

×
×
  • Create New...