Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,17 @@ ms.date: 12/20/2022

Universal Actions for Adaptive Cards provide a way to implement Adaptive Card based scenarios for both, Teams and Outlook. This document covers the following topics:

* [Schema used for Universal Actions for Adaptive Cards](#schema-for-universal-actions-for-adaptive-cards)
* [Refresh model](#refresh-model)
* [`adaptiveCard/action` invoke activity](#adaptivecardaction-invoke-activity)
* [Backward compatibility](#backward-compatibility)
- [Work with Universal Actions for Adaptive Cards](#work-with-universal-actions-for-adaptive-cards)
- [Quick start guide to use Universal Actions for Adaptive Cards in Teams](#quick-start-guide-to-use-universal-actions-for-adaptive-cards-in-teams)
- [Schema for Universal Actions for Adaptive Cards](#schema-for-universal-actions-for-adaptive-cards)
- [Action.Execute](#actionexecute)
- [Refresh model](#refresh-model)
- [User IDs in refresh](#user-ids-in-refresh)
- [`adaptiveCard/action` invoke activity](#adaptivecardaction-invoke-activity)
- [Backward compatibility](#backward-compatibility)
- [Teams](#teams)
- [Code samples](#code-samples)
- [See also](#see-also)

## Quick start guide to use Universal Actions for Adaptive Cards in Teams

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ With Single sign-on (SSO) in Teams, app users have the advantage of using Teams

For more information about Universal Actions for Adaptive Cards, see [Universal Actions for Adaptive Cards](Overview.md).

Adaptive Cards Universal Actions uses the bot as the common backend for handling actions and introduces a new action type. Bot uses Bot Framework to handle communication with the app users and to send and receive access token to the bot for SSO authentication. Similarly, Adaptive Cards Universal Actions also uses Bot Framework to enable SSO authentication.
Adaptive Cards Universal Actions uses the bot as the common backend for handling actions and introduces a new action type. Bot uses Microsoft 365 Agents SDK (previously known as Bot Framework SDK) to handle communication with the app users and to send and receive access token to the bot for SSO authentication. Similarly, Adaptive Cards Universal Actions also uses Microsoft 365 Agents SDK (previously known as Bot Framework SDK) to enable SSO authentication.

Ensure that you enable the SSO for your bot before you enable SSO for your Adaptive Cards Universal Actions.

Expand All @@ -23,15 +23,15 @@ Ensure that you enable the SSO for your bot before you enable SSO for your Adapt

## SSO in Teams at runtime

SSO for Adaptive Cards Universal Actions in a bot can be enabled by obtaining access token for the Teams app user who's signed in. This process involves the bot app client and server, Teams client, Bot Framework, and Microsoft Entra ID. During this interaction, the app user must give consent to obtain the access token in a multitenant environment.
SSO for Adaptive Cards Universal Actions in a bot can be enabled by obtaining access token for the Teams app user who's signed in. This process involves the bot app client and server, Teams client, Microsoft 365 Agents SDK (previously known as Bot Framework SDK), and Microsoft Entra ID. During this interaction, the app user must give consent to obtain the access token in a multitenant environment.

The following image shows how SSO works when a Teams app user attempts to access the Adaptive Cards Universal Actions in a bot:

:::image type="content" source="../../../assets/images/authentication/sso-runtime-seqd-adaptivecard.png" alt-text="Screenshot shows SSO flow for Adaptive Cards Universal Actions in a bot." lightbox="../../../assets/images/authentication/sso-runtime-seqd-adaptivecard.png":::

| # | Interaction | What's going on |
| --- | --- | --- |
| 1 | Teams client → Bot service | Teams sends an invoke `Action.Execute` request to the bot. <br> If the app user has previously signed in, a token is saved in the Bot Framework Token Store. The bot calls the Bot Framework Token Service that checks for an existing token for the app user in the Bot Framework Token Store. <br> • If the token exists, the app user is given access. <br> • If the token isn't available, the bot triggers the auth flow. |
| 1 | Teams client → Bot service | Teams sends an invoke `Action.Execute` request to the bot. <br> If the app user has previously signed in, a token is saved in the Microsoft 365 Agents SDK (previously known as Bot Framework SDK) Token Store. The bot calls the Microsoft 365 Agents SDK (previously known as Bot Framework SDK) Token Service that checks for an existing token for the app user in the Microsoft 365 Agents SDK (previously known as Bot Framework SDK) Token Store. <br> • If the token exists, the app user is given access. <br> • If the token isn't available, the bot triggers the auth flow. |
| 2 | Microsoft Entra ID → Teams client | For the app user who's using the Adaptive Cards Universal Actions in a bot for the first time, the token exchange can occur only after the app user gives the consent. Teams client displays a message to the app user for giving consent. <br> In case the consent fails: <br> 1. The authentication falls back to the sign-in prompt and the app user must sign in to use the bot app. The sign-in button appears in Teams client and when the app user selects it, the Microsoft Entra sign-in page appears. <br> 2. The app user signs in and grants access to the Bot service. |
| 3 | Teams Client → Bot service | Teams client resends the invoke `Action.Execute` request to the bot along with the token. <br> Bot service sends an invoke response with an OAuth card in response to `adaptiveCard/action` invoke call. Teams client sends the original `adaptiveCard/action` again to the bot along with the token. |
| 4 | Microsoft Entra ID → Teams client | Microsoft Entra ID sends invoke response with Adaptive Card to Teams client. Bot returns a nonerror response to the Teams client using either a card or message. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ When the app user selects **View and accept**, the existing Microsoft Entra perm
}
```

1. Teams client sends an invoke request to the bot. The bot receives the app users consent and uses their identity to help the token exchange process with the bot framework token service and Microsoft Entra ID. The bot framework token service delivers the app users access token to the bot.
1. Teams client sends an invoke request to the bot. The bot receives the app users consent and uses their identity to help the token exchange process with the Microsoft 365 Agents SDK (previously known as Bot Framework SDK) token service and Microsoft Entra ID. The Microsoft 365 Agents SDK (previously known as Bot Framework SDK) token service delivers the app users access token to the bot.
* Bot service ignores the access token if the value is incorrect.
* Bot service that experiences an error while performing token exchange must respond with an error or a second sign-in request that doesn't include SSO information. If the bot service responds with an error, the error must be:

Expand Down
36 changes: 18 additions & 18 deletions msteams-platform/task-modules-and-cards/cards/cards-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ms.date: 09/16/2024

# Types of cards

Adaptive, hero, list, connector card for Microsoft 365 Groups, receipt, sign in, and thumbnail cards and card collections are supported in bots for Microsoft Teams. They're based on cards defined by the Bot Framework, but Teams doesn't support all Bot Framework cards and has added some of its own.
Adaptive, hero, list, connector card for Microsoft 365 Groups, receipt, sign in, and thumbnail cards and card collections are supported in bots for Microsoft Teams. They're based on cards defined by the Microsoft 365 Agents SDK (previously known as Bot Framework SDK), but Teams doesn't support all Microsoft 365 Agents SDK (previously known as Bot Framework SDK) cards and has added some of its own.

Before you identify the different card types, understand how to create a hero card, thumbnail card, or Adaptive Card.

Expand Down Expand Up @@ -121,7 +121,7 @@ To explore Adaptive Card templates, see [Adaptive Card starter collection](desig

The following table provides the features that support Adaptive Cards:

| Bots in Teams | Tabs | Message extensions | Connectors | Bot Framework |
| Bots in Teams | Tabs | Message extensions | Connectors | Microsoft 365 Agents SDK |
| --- | --- | --- | --- |
| ✔️ | ❌ | ✔️ | ❌ | ✔️ |

Expand Down Expand Up @@ -310,7 +310,7 @@ Example:

```

Bot Framework reference:
Microsoft 365 Agents SDK reference:

* [Adaptive Cards Node](/azure/bot-service/bot-builder-howto-add-media-attachments?view=azure-bot-service-4.0&tabs=javascript&preserve-view=true#send-an-adaptive-card)
* [Adaptive Card C#](/azure/bot-service/bot-builder-howto-add-media-attachments?view=azure-bot-service-4.0&tabs=csharp&preserve-view=true#send-an-adaptive-card)
Expand All @@ -329,7 +329,7 @@ A card that typically contains a single large image, one or more buttons, and te

The following table provides the features that support hero cards:

| Bots in Teams | Message extensions | Connectors | Bot Framework |
| Bots in Teams | Message extensions | Connectors | Microsoft 365 Agents SDK |
| --- | --- | --- | --- |
| ✔️ | ✔️ | ❌ | ✔️ |

Expand Down Expand Up @@ -383,7 +383,7 @@ The following code shows an example of a hero card:

### Additional information on hero cards

Bot Framework reference:
Microsoft 365 Agents SDK reference:

* [Hero card Node.js](/azure/bot-service/bot-builder-howto-add-media-attachments?view=azure-bot-service-4.0&tabs=javascript&preserve-view=true#send-a-hero-card)
* [Hero card C#](/azure/bot-service/bot-builder-howto-add-media-attachments?view=azure-bot-service-4.0&preserve-view=true&tabs=csharp#send-a-hero-card)
Expand All @@ -396,7 +396,7 @@ The list card has been added by Teams to provide functions beyond what the list

The following table provides the features that support list cards:

| Bots in Teams | Message extensions | Connectors | Bot Framework |
| Bots in Teams | Message extensions | Connectors | Microsoft 365 Agents SDK |
| --- | --- | --- | --- |
| ✔️ | ❌ | ❌ |✔️ |

Expand Down Expand Up @@ -468,13 +468,13 @@ The following code shows an example of a list card:

## Connector card for Microsoft 365 Groups

You can work with a connector card for Microsoft 365 Groups that provides a flexible layout and is a great way to get useful information. The connector card for Microsoft 365 Groups is supported in Teams, not in Bot Framework. This card provides a flexible layout with multiple sections, fields, images, and actions. This card contains a connector card so that it can be used by bots. For differences between connector cards and the connector card for Microsoft 365 Groups, see [Connector card for Microsoft 365 Groups](#additional-information-on-the-connector-card-for-microsoft-365-groups).
You can work with a connector card for Microsoft 365 Groups that provides a flexible layout and is a great way to get useful information. The connector card for Microsoft 365 Groups is supported in Microsoft Teams, not in Microsoft 365 Agents SDK. This card provides a flexible layout with multiple sections, fields, images, and actions. This card contains a connector card so that it can be used by bots. For differences between connector cards and the connector card for Microsoft 365 Groups, see [Connector card for Microsoft 365 Groups](#additional-information-on-the-connector-card-for-microsoft-365-groups).

### Support for connector cards for Microsoft 365 Groups

The following table provides the features that support connector cards for Microsoft 365 Groups:

| Bots in Teams | Message extensions | Connectors | Bot Framework |
| Bots in Teams | Message extensions | Connectors | Microsoft 365 Agents SDK |
| --- | --- | --- | --- |
| ✔️ | ✔️ | ✔️ | ❌ |

Expand Down Expand Up @@ -598,7 +598,7 @@ Teams supports receipt card, which enables a bot to provide a receipt to the use

The following table provides the features that support receipt cards:

| Bots in Teams | Message extensions | Connectors | Bot Framework |
| Bots in Teams | Message extensions | Connectors | Microsoft 365 Agents SDK |
| --- | --- | --- | --- |
| ✔️ | ✔️ | ❌ | ✔️ |

Expand Down Expand Up @@ -657,28 +657,28 @@ The following code shows an example of a receipt card:

### Additional information on receipt cards

Bot Framework reference:
Microsoft 365 Agents SDK reference:

* [Receipt card Node.js](/javascript/api/botframework-schema/receiptcard?view=botbuilder-ts-latest&preserve-view=true)
* [Receipt card C#](/dotnet/api/microsoft.bot.schema.receiptcard?view=botbuilder-dotnet-stable&preserve-view=true)

## Sign in card

The sign in card in Teams is similar to the sign in card in the Bot Framework except that the sign in card in Teams only supports two actions `signin` and `openUrl`.
The sign in card in Microsft Teams is similar to the sign in card in the Microsoft 365 Agents SDK except that the sign in card in Microsoft Teams only supports two actions `signin` and `openUrl`.

The sign in action can be used from any card in Teams, not just the sign in card. For more information, see [Teams authentication flow for bots](~/bots/how-to/authentication/auth-flow-bot.md).

### Support for sign in cards

The following table provides the features that support sign in cards:

| Bots in Teams | Message extensions | Connectors | Bot Framework |
| Bots in Teams | Message extensions | Connectors | Microsoft 365 Agents SDK |
| --- | --- | --- | --- |
| ✔️ | ❌ | ❌ | ✔️ |

### Additional information on sign in cards

Bot Framework reference:
Microsoft 365 Agents SDK reference:

* [Sign in card Node.js](/javascript/api/botframework-schema/signincard?view=botbuilder-ts-latest&preserve-view=true)
* [Sign in card C#](/dotnet/api/microsoft.bot.schema.signincard?view=botbuilder-dotnet-stable&preserve-view=true)
Expand All @@ -691,7 +691,7 @@ You can work with a thumbnail card that is used for sending a simple actionable

The following table provides the features that support thumbnail cards:

| Bots in Teams | Message extensions | Connectors | Bot Framework |
| Bots in Teams | Message extensions | Connectors | Microsoft 365 Agents SDK |
| --- | --- | --- | --- |
| ✔️ | ✔️ | ❌ | ✔️ |

Expand Down Expand Up @@ -757,7 +757,7 @@ The following code shows an example of a thumbnail card:

### Additional information

Bot Framework reference:
Microsoft 365 Agents SDK reference:

* [Thumbnail card Node.js](/javascript/api/botframework-schema/thumbnailcard?view=botbuilder-ts-latest&preserve-view=true)
* [Thumbnail card C#](/dotnet/api/microsoft.bot.schema.thumbnailcard?view=botbuilder-dotnet-stable&preserve-view=true)
Expand All @@ -774,7 +774,7 @@ The [carousel layout](/azure/bot-service/bot-builder-howto-add-media-attachments

The following table provides the features that support carousel collections:

| Bots in Teams | Message extensions | Connectors | Bot Framework |
| Bots in Teams | Message extensions | Connectors | Microsoft 365 Agents SDK |
| --- | --- | --- | --- |
| ✔️ | ❌ | ❌ | ✔️ |

Expand Down Expand Up @@ -968,7 +968,7 @@ The list layout shows a vertically stacked list of cards, optionally with associ

The following table provides the features that support list collections:

| Bots in Teams | Message extensions | Connectors | Bot Framework |
| Bots in Teams | Message extensions | Connectors | Microsoft 365 Agents SDK |
| --- | --- | --- | --- |
| ✔️ | ✔️ | ❌ | ✔️ |

Expand All @@ -989,7 +989,7 @@ A list can display a maximum of 10 cards per message.

## Cards not supported in Teams

The following cards are implemented by the Bot Framework, but aren't supported by Teams:
The following cards are implemented by the Microsoft 365 Agents SDK (previously known as Bot Framework SDK), but aren't supported by Microsoft Teams:

* Animation cards
* Audio cards
Expand Down