Authenticaiton UserSessionId

Issues when playing with WebRTC Player

Authenticaiton UserSessionId

Postby bstinson » Mon Jul 16, 2018 11:29 am

In your sample project WebRTC_MultiChat, you specify the adding of session ids using the following code

//Add users's session ID to the Media Server Session manager.
ExternalSession MediaServerSessionMngr = new ExternalSession();
MediaServerSessionMngr.AddSession(Session.SessionID.ToString(), TextBoxUserName.Text);

Where is the session id stored? In memory, disk? How can I view all registered sessions?
bstinson
 
Posts: 0
Joined: Mon Jul 09, 2018 1:05 pm

Re: Authenticaiton UserSessionId

Postby admin » Mon Jul 16, 2018 11:55 am

Please read the documentation on session-based authentication.

This session id is the session id of your web application user session, whom your web app has just authenticated.
Note that it can be any unique token, doesn't need to be session id - you can create another token for authenticated user. Session id is used in this sample for simplicity.
So your web app knows all the users that it authenticates; you can also add each authenticated user to your own collection, if you prefer.
This is all web app code, nothing to do with Unreal Media Server.

The only interaction with Unreal Media Server is these lines:
ExternalSession MediaServerSessionMngr = new ExternalSession();
MediaServerSessionMngr.AddSession(Session.SessionID.ToString(), TextBoxUserName.Text);

It means you are letting Unreal Media server know that the user with this token and username is allowed to view video.
Unreal Media Server keeps a list of these sessions in memory, never on hard drive.
So when the request from webpage will be sent to Unreal Media Server (in this case, using WebRTC signalling), that request will also contain the same session id, so Unreal Media Server will recognize this user.
admin
Site Admin
 
Posts: 1030
Joined: Fri Aug 21, 2009 10:13 am


Return to Playing with WebRTC Player

Who is online

Users browsing this forum: No registered users and 1 guest

cron