Forum Discussion

dmsaprykin's avatar
dmsaprykin
Copper Contributor
Jul 12, 2022

Adaptive cards oauthCard renders as an empty rectangular

Hi, 

What I'm doing is in onInstallationUpdateAdd of my ActivityHandler I want to render an oAuth popup card, so that I can later pull user/team details, create a new channel and post in it. Instead of bot dialog I'm trying to send an ActiveCard. I added oauth connection to my bot with props:

clientId: my app's id,

client secret: secret generated in certificates and secrets of my app

grant_type: authorization_code

login url: https://login.microsoftonline.com 

tenantId: copied from my app

resource url: https://graph.microsoft.com

scopes: User.Read.All,TeamSettings.Read.All

 

 

 

 

const userTokenClient = context.turnState.get(context.adapter.UserTokenClientKey);

const { signInLink } = await userTokenClient.getSignInResource(
        this.connectionName,
        context.activity
      );
    
      const ssoCard = CardFactory.oauthCard(
        this.connectionName, // Replace with the name of your Azure AD connection
        'Sign In',
        'Please sign in to install Matterapp',
        signInLink
      );

      await context.sendActivity({
        attachments: [
          CardFactory.adaptiveCard(ssoCard)
        ]
      }

 

 

 

 

I see no errors, no logs, and teams bot chat shows an empty rectangle. What do I do wrong? Can the auth be prompted like that (still struggling to find how to show adaptive card in a popup though). 

 

Thank you

Resources