I am developing my first bot from Microsoft Teams.
I want the user to input commands in the bot, the bot should send requests to my external web sever and display the results as adaptive cards. I was able to authenticate the bot with my external server. The bot shows the user access token after authentication. Perfect!
How can I get the user's access token in my bot code or web server to process the incoming request from the bot. Here's what my bot code looks like.
this.onMessage(async (context, next) => {
//I need a way to get the user's access token here
//or a way to fetch the access token from my web server
//based on some id in the context.
const response = await myWebService.getData(context);
// Run the Dialog with the new message Activity.
await this.dialog.run(context, this.dialogState);
await next();
});
What am I missing here?