Forum Discussion
usman9012
Dec 27, 2021Copper Contributor
How can open sign in dialog inside the ms team
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();
});
Maybe Rick Van Rousselt or YannickReekmans will be able to help and give advice with this one
Hope that helps
Best, Chris
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:
- https://docs.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-actions?tabs=json&WT.mc_id=M365-MVP-5003400#action-type-signin
- microsoft/BotBuilder-Samples: Welcome to the Bot Framework samples repository. Here you will find task-focused samples in C#, JavaScript and TypeScript to help you get started with the Bot Framework SDK! (github.com)
- Meghana-MSFTMicrosoft
usman9012 - Did the above solution solve your issue? Or you need further help?
- VijayTapaniyaCopper ContributorI have the same issue , i have also tried "signin" but isn't worked if you have any reference related this , please share...
- Meghana-MSFTMicrosoftCan you please let me know if signin is not working or sign in dialog box is opening in browser.