在使用Directline频道通过WebChat使用MS Botframework V4(c#)时,用户名在stepContext.Context.Activity.From.Name中不可用 问题陈述

在使用Directline频道通过WebChat使用MS Botframework V4(c#)时,用户名在stepContext.Context.Activity.From.Name中不可用 问题陈述,c#,azure-active-directory,botframework,direct-line-botframework,web-chat,C#,Azure Active Directory,Botframework,Direct Line Botframework,Web Chat,我使用MS Botframework V4(c#),通过MS网络聊天使用Directline频道。已成功与Azure Active directory集成,并且我能够从MS Web聊天小部件使用Azure AD帐户成功进行身份验证/登录。 很遗憾登录的用户名在stepContext.Context.Activity.From.Name属性中不可用 其他详情 以下是使用MS Bot framework Emulator调试时的其他属性值: stepContext.Context.Activity.

我使用MS Botframework V4(c#),通过MS网络聊天使用Directline频道。已成功与Azure Active directory集成,并且我能够从MS Web聊天小部件使用Azure AD帐户成功进行身份验证/登录。

很遗憾登录的用户名在stepContext.Context.Activity.From.Name属性中不可用

其他详情 以下是使用MS Bot framework Emulator调试时的其他属性值:
stepContext.Context.Activity.ChannelId:“仿真器”
stepContext.Context.Activity.CallerId:“urn:botframework:azure”
stepContext.Context.Activity.From.Name:“用户”
stepContext.Context.Activity.From.Role:“用户”
stepContext.Context.Activity.TextFormat:“普通”
stepContext.Context.Activity.Recipient.Name:“Bot”

视觉漫游 从OAuthPrompt对话框中的登录按钮

显示Active Directory登录对话框

六位OTP/令牌复制并粘贴为聊天机器人输入

成功登录后用户名不正确

客户端网络聊天/直接线路代码

MS Bot框架代码打印登录的用户名

查询 如果有人能够在使用Azure Active Directory凭据通过MS Web chat通过直连频道成功登录后帮助获取登录用户名,将不胜感激。

经过一些研究和耐心,找到了解决方案 使用以下代码,该代码在提供Active Directory上的Graph API权限后工作

它无缝地工作。在授予上述Graph API权限后请耐心等待,因为它需要一段时间才能得到传播/应用

经过一些研究和耐心,找到了解决方案 使用以下代码,该代码在提供Active Directory上的Graph API权限后工作

它无缝地工作。在授予上述Graph API权限后请耐心等待,因为它需要一段时间才能得到传播/应用