Forum Discussion
Correlating anonymous user ID (meeting app context and bot)
I have the following problem: I'm creating a Teams meeting app that is supposed to be used by anonymous users that can join via meeting link using the web version of Microsoft Teams. The app is shared to the meeting stage by the organizer and is correctly displayed by anonymous users, but it seems that there's no way to correlate the user ID that is available through context from javascript SDK (that looks like this: 8:teamsvisitor:ecfffc40c0be492da74621ce52011a22) with the ID that the bot gets when OnTeamsMembersAdded event is fired for the same user (29:1AUqWyWMQciXXvShFEnTYUoM4-Efaw6WZZZFN3fOVdOpewtmkYUXwSgUr05hPs0dub1t7tqPw4b9t0r7G2k7zfA).
I need to call the backend service from Javascript, but it seems that using only the user ID from context and not being able to generate SSO token for the anonymous user from Teams web app, there's no way to know who is making the call, as the IDs available on frontend and backend side are totally different. Is there any method to map one ID to another or some other way to do it that I'm missing?
Here's the code I'm using to get the user's details from the TeamsMembersAdded event:
var members = await TeamsInfo.GetMembersAsync(turnContext, cancellationToken);
foreach (var member in members)
{
var teamsParticipant = await TeamsInfo.GetMeetingParticipantAsync(turnContext, participantId: member.Id, cancellationToken: cancellationToken);
}
3 Replies
- Hans_ZietsmanCopper Contributor
Tomasz Telepko , did you ever figure this out? We are having a similar issue correlating different user IDs received from 'GetContext' and 'GetMember' API for the same anonymous user
- Nivedipa-MSFT
Microsoft
Could you please share which sample you are referring for this issue? It help us to repro the issue.
- Nivedipa-MSFT
Microsoft
We tried to get user ID through context using JavaScript SDK as you mentioned but we are not able to get it.
Could you please share the steps for getting the user ID through context from JavaScript SDK?
Also could you please share the steps for generating SSO token for anonymous user and for normal user?