Forum Discussion
oauthCard works on azure but not teams - "Something went wrong. Please try again."
Im trying to create a teams app/bot using oauthCard to connect to auth0. When I deploy the bot to Azure and "Test in web chat", it works fine, and pops up a new window with the auth page. However when I try the bot in teams, the card has a message: "Something went wrong. Please try again.". There are no console logs or network traffic when clicking on the button. Id appreciate help, even if its just telling me where I can find debug info.
Here is where Im implementing the card:
// Trigger command by IM text
switch (txt) {
case "welcome": {
const card = AdaptiveCards.declareWithoutData(rawWelcomeCard).render();
await context.sendActivity({ attachments: [CardFactory.adaptiveCard(card)] });
break;
}
case "learn": {
this.likeCountObj.likeCount = 0;
const card = AdaptiveCards.declare<DataInterface>(rawLearnCard).render(this.likeCountObj);
await context.sendActivity({ attachments: [CardFactory.adaptiveCard(card)] });
break;
}
case "login": {
const oauthCard = CardFactory.oauthCard(
'authconnection',
'Please sign in',
'Sign In'
);
await context.sendActivity({ attachments: [oauthCard] });
break;
}
}
Here is my manifest. Thought the issue could be with validDomains thus all the wild cards:
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.16/MicrosoftTeams.schema.json",
"manifestVersion": "1.16",
"version": "1.0.0",
"id": "${{TEAMS_APP_ID}}",
"packageName": "com.microsoft.teams.extension",
"developer": {
"name": "Teams App, Inc.",
"websiteUrl": "https://www.example.com",
"privacyUrl": "https://www.example.com/termofuse",
"termsOfUseUrl": "https://www.example.com/privacy"
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"name": {
"short": "cr-teams-app-${{TEAMSFX_ENV}}",
"full": "full name for cr-teams-app"
},
"description": {
"short": "short description for cr-teams-app123",
"full": "full description for cr-teams-app"
},
"accentColor": "#FFFFFF",
"bots": [
{
"botId": "${{BOT_ID}}",
"scopes": [
"personal",
"team",
"groupchat"
],
"isNotificationOnly": false,
"supportsCalling": false,
"supportsVideo": false,
"supportsFiles": false,
"commandLists": [
{
"scopes": [
"personal",
"team",
"groupchat"
],
"commands": [
{
"title": "welcome",
"description": "Resend welcome card of this Bot"
},
{
"title": "learn",
"description": "Learn about Adaptive Card and Bot Command"
},
{
"title": "login",
"description": "Connect to Controlrooms.ai"
}
]
}
]
}
],
"configurableTabs": [],
"staticTabs": [],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": [
"token.botframework.com",
"${{BOT_DOMAIN}}",
"*.azurewebsites.net",
"*.*.portal.azure.net",
"*.com",
"*.*.com",
"*.*.*.com",
"*.*.*.*.com",
"*.net",
"*.*.net",
"*.*.*.net",
"*.*.*.*.net",
"*.ai",
"*.*.ai",
"*.*.*.ai",
"*.*.*.*.ai"
],
"webApplicationInfo": {
"id": "${{BOT_ID}}",
"resource": "api://botid-${{BOT_ID}}"
}
}
Thanks again for any help.
- Sayali-MSFTMicrosoftdlinncr - Thanks for reporting your issue.
We will check this at our end and will get back to you.- dlinncrCopper Contributor
Sayali-MSFT
Thank you. We are trying to authenticate with auth0. Any further documentation that would help us would be appreciated. So far everything seems to point to Azure AD.- Sayali-MSFTMicrosoft
dlinncr -Could you please refer this sample-Microsoft-Teams-Samples/samples/bot-all-cards/csharp at main · OfficeDev/Microsoft-Teams-Samples (github.com)
Document Link-Add authentication to your Teams bot - Teams | Microsoft Learn