Bot 框架 - 隐藏文本 activity

Bot Framework - Hide text activity

可以从私有异步任务中隐藏文本 Activity(例如文本字段上的密码 属性)吗?

示例:

我把我的 id 放在机器人模拟器上:admin

->我的应用程序正在请求我的密码

当我写的时候希望它像这样显示:********

感谢您的帮助。

谢谢。

目前不是 Bot Framework 的功能。

考虑改用机器人身份验证工作流程。

机器人身份验证资源

https://blogs.msdn.microsoft.com/richard_dizeregas_blog/2017/05/15/bot-authentication-in-the-bot-framework/

身份验证 - .NET 示例

您可能想先观看此视频:https://channel9.msdn.com/Shows/Office-Dev-Show/Office-Dev-Show-Episode-34-Getting-Started-with-Bots-and-the-Microsoft-Graph

接下来,您可以研究这个代码示例,它演示了 Bot Framework 与 Active Directory 的集成。 https://github.com/MicrosoftDX/AuthBot

您还可以考虑查看登录卡示例,它也可用于通过 Web 登录对您的机器人进行身份验证。

文档: - https://docs.microsoft.com/en-us/bot-framework/dotnet/bot-builder-dotnet-add-rich-card-attachments#add-a-sign-in-card-to-a-message

代码示例: - https://github.com/Microsoft/BotBuilder-Samples/tree/master/CSharp/cards-RichCards

签到卡:

Activity replyToConversation = message.CreateReply("Should go to conversation");
replyToConversation.Attachments = new List<Attachment>();

List<CardAction> cardButtons = new List<CardAction>();

CardAction plButton = new CardAction()
{
    Value = $"https://<OAuthSignInURL",
    Type = "signin",
    Title = "Connect"
};

cardButtons.Add(plButton);

SigninCard plCard = new SigninCard(title: "You need to authorize me", button: plButton);

Attachment plAttachment = plCard.ToAttachment();
replyToConversation.Attachments.Add(plAttachment);

var reply = await connector.Conversations.SendToConversationAsync(replyToConversation);