1

I am trying to implement the functionality of the password as shown in this link. https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/05.custom-components/f.password-input

but how to pass the password activity form the bot to the front end. I am using the c# template for the developing the bot.

As per my understanding, we need to pass a password activity from the bot to the front-end for the execution of the password things as mentioned in the link.

An example would be help-full in knowing how to pass this type of customer activity forms the bot.

Thanks,

  • Accepting / upvoting an answer serves the greater Stack Overflow community and anyone with a similar question. If you feel my answer was sufficient, please "accept" and upvote it. If not, let me know how else I can help! – Hessel May 14 '20 at 07:04

1 Answers1

0

I used this sample myself for one of my bots. The bot logic is built in node but I guess it shouldn't be hard to translate to c#

        const askPwd =
    {
        name: 'passwordInput',
        type: 'event'
    };
    await stepContext.context.sendActivity(askPwd);
    return await stepContext.prompt(PASSWORD_PROMPT, '');

In c# this will probabaly translate into something like this (I don't know c#):

Activity activity = new Activity
        {
            Type = ActivityTypes.Event,
            Name = "passwordInput"
        };
        await stepContext.Context.SendActivityAsync(activity, cancellationToken);});
Hessel
  • 613
  • 1
  • 6
  • 15
  • Thanks for the information. I will try this and update you. I have one more question as is this is possible in react js only if yes then can you let me know how we can integrate react js with the c# bot framework(dot net core). – user9582192 May 14 '20 at 08:32
  • Sure you can send events to your webchat using c#. See also: https://stackoverflow.com/questions/59986718/botframework-v4-how-to-send-an-event-from-the-bot-and-catch-it-in-react-webchat – Hessel May 14 '20 at 09:00