BotBuilder-MicrosoftTeams-dotnet icon indicating copy to clipboard operation
BotBuilder-MicrosoftTeams-dotnet copied to clipboard

[Bug]

Open clearab opened this issue 6 years ago • 9 comments

Describe the bug When using: var requestor = teamsContext.AsTeamsChannelAccount(turnContext.Activity.From); The resulting TeamsChannelAccount object doesn't have any of the Teams specific information added. For example request.UserPrincipalName is always null request.Surname is also always null

SDK Version 4.0.0-beta1

Expected behavior Those properties should be populated

clearab avatar Jan 25 '19 23:01 clearab

This is as expected. From field sends user's Id, user's AADObjectId and name.

RamjotSingh avatar Jan 26 '19 00:01 RamjotSingh

Then how do you populate the rest of the Teams properties in resulting TeamsChannelAccount object?

clearab avatar Jan 26 '19 00:01 clearab

Doing something like:

var roster = teamsContext.GetConversationParametersForCreateOrGetDirectConversation(turnContext.Activity.From).Members;
List<TeamsChannelAccount> rosterTC = roster.ToList().ConvertAll(member =>
  {
    return teamsContext.AsTeamsChannelAccount(member);
  });

Also results in nulls

clearab avatar Jan 26 '19 00:01 clearab

If you want extended information about the user, one option is to get it through Microsoft Graph. You will need additional approval from user or tenant admin for it though.

RamjotSingh avatar Jan 26 '19 00:01 RamjotSingh

Then what is the purpose of that method? It seems to add no additional information to the default ChannelAccount object, just a bunch of properties that are always null?

clearab avatar Jan 26 '19 00:01 clearab

GetConversationMembersAsync should have that information filled up.

RamjotSingh avatar Jan 26 '19 00:01 RamjotSingh

Can you add an example of that? I'm having a hard time figuring out how to get a fully hydrated TeamsChannelAccount object

clearab avatar Jan 26 '19 01:01 clearab

@RamjotSingh I'm experiencing this bug as well... Any solution available yet?

MaikelW avatar May 13 '19 11:05 MaikelW

Same problem here. :/

fmichellonet avatar May 23 '19 15:05 fmichellonet