Search code examples
botframeworkbot-framework-composer

How to force the user to login before using the bot?


How to force the user to login before being allowed to see the messages or reply with bots created using Bot Framework Composer?

I used the Oauth prompt card but that only ask to log in once. If the user clicks 'cancel' the bot still works for them.


Solution

  • You can first prompt the user for login in the Greeting dialog. You can then save the user token in a variable, so you can check if the token exists at the start of any intent and prompt the user to login if the token does not exist / is not valid.