-
-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
integrating an external auth service - peer id/uid #202
Comments
Yes, i am also facing the same issue. you will have to use data channels to manage this |
@Knat-Dev when u create localStream you can get its "id" using localStream.id and then u can pass that along the data channel with user id. this via the data channel you are able to send your user information with stream id also there is another problem in this, pion works on the basis of track instead of a stream. so we have an onTrack function, and this will be called separately for audio/ video track if you re-negotiate a track again the ontrack function is callsed with the new stream id |
Thanks for the reply, I already managed to work it out using a data channel. This is what I did for those who come by this issue in the future:
This is what I implemented to integrate my auth service. |
I'm sorry for not using a template, but it isn't a bug report nor a feature request.
I'm trying to integrate my own auth service (uses nestjs along with typeorm , postgres and jwt) along with the sfu, using ion-sdk-js with react on the frontend.
First of all, I managed to create a working conference (currently audio only for I have no webcam) call easily using ion-sfu's docker image and the frontend library, it was an awesome experience so that's first!
I messed around with the frontend library, I can see a way to send a user id to the sfu and it works great (I can see the peer id being printed in the signaling process logs).
the problem is I don't see how I'm supposed to consume this value (nor do I know whether I should).
I read the FAQ of ion-sfu's git repo and it was mentioned that the apps should use the streamId and map that to a user value of a sort.
the streamId doesn't seem to contain a hint of peer info or uid so I'd appreciate it if anyone could point me to an article about how to do such a mapping
I stil lwonder why do we pass a uid to the Join function if we can't use it along with the incoming tracks or onspeaker, or maybe there's a best practice that I missed?
Thanks in advance
Edit: I can see how I could make use of a data channel to pass user data along, is this the best way though?
The text was updated successfully, but these errors were encountered: