Dec 27 2021 01:24 AM
I am trying to create custom app through bot framework i want to open sign in dialog box inside the ms teams but i don't know how can i do this every time when i click on link sign in page open in the browser. I am testing in emulator every time when i click on link it open in browser
welcome.json
{
"type": "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.2",
"body": [
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "Hi! I'm Bot - welcome to our app for Microsoft Team!",
"wrap": true,
"weight": "Bolder"
}
]
},
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"wrap": true,
"weight": "Lighter",
"text": "I'm here to help you manage your tickets with in teams."
},
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "Here's what can i do:"
},
{
"type": "TextBlock",
"text": "Create a new ticket.",
"wrap": true
}
]
}
],
"verticalContentAlignment": "Bottom"
},
{
"type": "TextBlock",
"text": "Post ticket related notifications to the team channel of your choice.",
"wrap": true
},
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "For more information, visit our [knowledge base article](https://example.com/blog/). If you're the help desk administrator, please link to start using Bot for Microsoft Teams, [Book a demo](https://example.com/) if you don't have account",
"wrap": true
}
]
},
{
"type": "Container",
"items": [
{
"type": "ActionSet",
"actions": [
{
"type": "Action.OpenUrl",
"title": "Link",
"url": "https://ngrok.io/sign_in"
}
]
}
]
}
]
}
bot.ts
this.onMembersAdded(async (context, next) => {
const welcomeCard: Attachment = CardFactory.adaptiveCard(WelcomeCard);
const membersAdded = context.activity.membersAdded;
for (const member of membersAdded) {
if (member.id !== context.activity.recipient.id) {
// If we are in Microsoft Teams
if (context.activity.channelId === 'msteams') {
// Send a message with an @Mention
await this._messageWithMention(context, member, welcomeCard);
} else {
await context.sendActivity({ attachments: [welcomeCard] });
}
}
}
// By calling next() you ensure that the next BotHandler is run.
await next();
});
Dec 27 2021 02:48 AM
Maybe @Rick Van Rousselt or @YannickReekmans will be able to help and give advice with this one
Hope that helps
Best, Chris
Dec 28 2021 05:47 AM
I'm not an expert, but the Action.OpenUrl type that you use, will always open the default browser so this is expected behavior. I think you need to change this to "type": "signin",
Here are some links that might help you:
Dec 29 2021 04:35 AM
@usman9012 - Did the above solution solve your issue? Or you need further help?
Feb 03 2023 04:36 AM
Feb 08 2023 01:45 AM