Forum Discussion

dlinncr's avatar
dlinncr
Copper Contributor
Oct 25, 2023

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.

Resources