Jul 12 2022 01:15 PM - edited Jul 12 2022 02:07 PM
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
Jul 13 2022 01:08 AM - edited Jul 13 2022 01:12 AM
Solution
oAuth Card is a different type of card. It should not be rendered in adaptive card. Please check the Using Cards sample. Which uses rich cards - BotBuilder-Samples/mainDialog.js at 901bc140f5aa300fbfa852e64afd7c65fceebff9 · microsoft/BotBuilder-...
Thanks,
Meghana
----------------------------------------------------------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.
Jul 13 2022 10:34 AM
Jul 25 2022 12:51 AM