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
4 changes: 4 additions & 0 deletions .github/workflows/build-complete-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,10 @@ jobs:
name: 'bot-auth0-adaptivecard'
version: '6.0.x'

- project_path: 'samples/tab-auth-entra-account/csharp/TabAuthEntraAccount/TabAuthEntraAccount.csproj'
name: 'tab-auth-entra-account'
version: '6.0.x'

fail-fast: false
name: Build All "${{ matrix.name }}" csharp
steps:
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ The [Teams Toolkit](https://marketplace.visualstudio.com/items?itemName=TeamsDev
| 24 | Tab External Auth | This sample illustrates how to implement Google auth using external auth providers. | Advanced | [View][tab-external-auth#csharp] | | | |
| 25 | Nested App Authentication | This sample shows nested app authentication (NAA), a new protocol that simplifies single sign-on (SSO) for single-page applications. | Advanced | [View][tab-nested-auth#cs] | [View][tab-nested-auth#nodejs] ![toolkit-icon](assets/toolkit-icon.png) | |[View](/samples/tab-nested-auth/csharp/demo-manifest/tab-nested-auth.zip) | | |
| 26 | Tab Meeting Recording and transcript with auto recording | This sample shows meeting recording and transcript with auto recording. | Advanced | [View][tab-meeting-auto-recording#csharp] | | | |
| 27 | Tab External Auth | This sample illustrates how to implement Google auth using external auth providers. | Advanced | [View][tab-external-auth#csharp] | | | |
| 27 | Sign in using a different Microsoft Entra account | Teams tab sample showing auth and account switching with Entra ID. | Advanced | [View][tab-auth-entra-account#csharp] | | | |
| 28 | Tab Meeting Recording and transcript with auto recording | This sample shows meeting recording and transcript with auto recording. | Advanced | [View][tab-meeting-auto-recording#csharp] | | | |
## [Bots samples](https://docs.microsoft.com/microsoftteams/platform/bots/what-are-bots) (using the v4 SDK)
>NOTE:
Expand Down Expand Up @@ -300,6 +300,7 @@ The [Teams Toolkit](https://marketplace.visualstudio.com/items?itemName=TeamsDev
[tab-multi-hub#ts]:samples/tab-multi-hub/ts
[tab-ui-templates#ts]:samples/tab-ui-templates/ts
[tab-external-auth#csharp]:samples/tab-external-auth/csharp
[tab-auth-entra-account#csharp]:samples/tab-auth-entra-account/csharp
[tab-meeting-transcript-recording#nodejs]:samples/tab-meeting-transcript-recording/nodejs
[tab-meeting-transcript-recording#csharp]:samples/tab-meeting-transcript-recording/csharp
[tab-adhoccalls-transcript-recording#nodejs]:samples/tab-adhoccalls-transcript-recording/nodejs
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions samples/tab-auth-entra-account/csharp/M365Agent/M365Agent.ttkproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" Sdk="Microsoft.TeamsFx.Sdk">
<PropertyGroup Label="Globals">
<ProjectGuid>42a0237c-30e0-42ae-b6ed-50f318517e77</ProjectGuid>
</PropertyGroup>
<ItemGroup>
<None Include="m365agents.local.yml" />
<None Include="m365agents.yml" />
</ItemGroup>
<ItemGroup>
<ProjectCapability Include="ProjectConfigurationsDeclaredDimensions" />
</ItemGroup>
</Project>
50 changes: 50 additions & 0 deletions samples/tab-auth-entra-account/csharp/M365Agent/aad.manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"id": "${{AAD_APP_OBJECT_ID}}",
"appId": "${{AAD_APP_CLIENT_ID}}",
"displayName": "tab-auth-entra-account-aad",
"signInAudience": "AzureADMultipleOrgs",
"api": {
"requestedAccessTokenVersion": 2
},
"info": {},
"optionalClaims": {
"idToken": [],
"accessToken": [
{
"name": "idtyp",
"source": null,
"essential": false,
"additionalProperties": []
}
],
"saml2Token": []
},
"publicClient": {
"redirectUris": []
},
"requiredResourceAccess": [
{
"resourceAppId": "00000003-0000-0000-c000-000000000000",
"resourceAccess": [
{
"id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d",
"type": "Scope"
}
]
}
],
"web": {
"redirectUris": [],
"implicitGrantSettings": {
"enableAccessTokenIssuance": true,
"enableIdTokenIssuance": true
}
},
"spa": {
"redirectUris": [
"${{BOT_ENDPOINT}}/Auth/AuthStart",
"${{BOT_ENDPOINT}}/Auth/AuthEnd"
]
},
"isFallbackPublicClient": true
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/teams/v1.19/MicrosoftTeams.schema.json",
"manifestVersion": "1.19",
"version": "1.0.0",
"id": "${{TEAMS_APP_ID}}",
"developer": {
"name": "Microsoft",
"websiteUrl": "https://www.microsoft.com",
"privacyUrl": "https://www.microsoft.com/privacy",
"termsOfUseUrl": "https://www.microsoft.com/termsofuse"
},
"name": {
"short": "Tab Auth Entra Accounts",
"full": "Sign in using a different Microsoft Entra account"
},
"description": {
"short": "Teams tab sample showing auth and account switching with Entra ID.",
"full": "This Microsoft Teams tab sample demonstrates how to integrate Microsoft Entra ID (Azure AD) authentication. It allows users to sign in and switch between different Entra accounts for secure, flexible access. Use a different Entra account to sign in to the application."
},
"icons": {
"outline": "outline.png",
"color": "color.png"
},
"accentColor": "#60A18E",
"staticTabs": [
{
"entityId": "auth",
"name": "Auth",
"contentUrl": "https://${{BOT_DOMAIN}}/Home/Index",
"scopes": [
"personal"
]
}
],
"validDomains": [
"${{BOT_DOMAIN}}"
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions samples/tab-auth-entra-account/csharp/M365Agent/env/.env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This file includes environment variables that can be committed to git. It's gitignored by default because it represents your local development environment.

# Built-in environment variables
TEAMSFX_ENV=local

# Generated during provision, you can also add your own variables.
TEAMS_APP_ID=
AAD_APP_CLIENT_ID=
AAD_APP_OBJECT_ID=
AAD_APP_OAUTH2_PERMISSION_ID=
AAD_APP_TENANT_ID=
AAD_APP_OAUTH_AUTHORITY_HOST=
AAD_APP_OAUTH_AUTHORITY=
TAB_ENDPOINT=




APP_NAME_SUFFIX=
TAB_DOMAIN=
TEAMS_APP_TENANT_ID=
M365_TITLE_ID=
M365_APP_ID=
TEAMSFX_M365_USER_NAME=

BOT_ENDPOINT=
BOT_DOMAIN=
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"profiles": {
// Debug project within Teams
"Microsoft Teams (browser)": {
"commandName": "Project",
"launchUrl": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&appTenantId=${{TEAMS_APP_TENANT_ID}}&login_hint=${{TEAMSFX_M365_USER_NAME}}"
},
"Outlook (browser)": {
"commandName": "Project",
"launchUrl": "https://outlook.office.com/host/${{M365_APP_ID}}?login_hint=${{TEAMSFX_M365_USER_NAME}}"
},
"Microsoft 365 app (browser)": {
"commandName": "Project",
"launchUrl": "https://www.office.com/m365apps/${{M365_APP_ID}}?auth=2&login_hint=${{TEAMSFX_M365_USER_NAME}}"
},
// Launch project within Teams without prepare app dependencies
"Microsoft Teams (browser) (skip update app)": {
"commandName": "Project",
"environmentVariables": { "UPDATE_TEAMS_APP": "false" },
"launchUrl": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&appTenantId=${{TEAMS_APP_TENANT_ID}}&login_hint=${{TEAMSFX_M365_USER_NAME}}"
}
}
}
103 changes: 103 additions & 0 deletions samples/tab-auth-entra-account/csharp/M365Agent/m365agents.local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# yaml-language-server: $schema=https://aka.ms/teams-toolkit/v1.8/yaml.schema.json
# Visit https://aka.ms/teamsfx-v5.0-guide for details on this file
# Visit https://aka.ms/teamsfx-actions for details on actions
version: v1.8

additionalMetadata:
sampleTag: Microsoft-Teams-Samples:tab-auth-entra-account-csharp

provision:
# Creates a new Azure Active Directory (AAD) app to authenticate users if
# the environment variable that stores clientId is empty
- uses: aadApp/create
with:
# Note: when you run aadApp/update, the AAD app name will be updated
# based on the definition in manifest. If you don't want to change the
# name, make sure the name in AAD manifest is the same with the name
# defined here.
name: tab-auth-entra-account-aad
# If the value is false, the action will not generate client secret for you
generateClientSecret: true
# Authenticate users with a Microsoft work or school account in your
# organization's Azure AD tenant (for example, single tenant).
signInAudience: AzureADMultipleOrgs
# Write the information of created resources into environment file for the
# specified environment variable(s).
writeToEnvironmentFile:
clientId: AAD_APP_CLIENT_ID
# Environment variable that starts with `SECRET_` will be stored to the
# .env.{envName}.user environment file
clientSecret: SECRET_AAD_APP_CLIENT_SECRET
objectId: AAD_APP_OBJECT_ID
tenantId: AAD_APP_TENANT_ID
authority: AAD_APP_OAUTH_AUTHORITY
authorityHost: AAD_APP_OAUTH_AUTHORITY_HOST

# Set TAB_DOMAIN and TAB_ENDPOINT for local launch
- uses: script
with:
run: echo "::set-teamsfx-env TAB_DOMAIN=localhost:44302"; echo
"::set-teamsfx-env TAB_ENDPOINT=https://localhost:44302";

# Creates a Teams app
- uses: teamsApp/create
with:
# Teams app name
name: tab-auth-entra-account-${{TEAMSFX_ENV}}
# Write the information of created resources into environment file for
# the specified environment variable(s).
writeToEnvironmentFile:
teamsAppId: TEAMS_APP_ID

# Generate runtime appsettings to JSON file
- uses: file/createOrUpdateJsonFile
with:
target: ../TabAuthEntraAccount/appsettings.json
content:
AzureAd:
ClientId: ${{AAD_APP_CLIENT_ID}}
RedirectUri: https://${{BOT_DOMAIN}}/Auth/AuthEnd

# Apply the AAD manifest to an existing AAD app. Will use the object id in
# manifest file to determine which AAD app to update.
- uses: aadApp/update
with:
# Relative path to this file. Environment variables in manifest will
# be replaced before apply to AAD app
manifestPath: ./aad.manifest.json
outputFilePath: ./build/aad.manifest.${{TEAMSFX_ENV}}.json

# Validate using manifest schema
- uses: teamsApp/validateManifest
with:
# Path to manifest template
manifestPath: ./appPackage/manifest.json
# Build Teams app package with latest env value
- uses: teamsApp/zipAppPackage
with:
# Path to manifest template
manifestPath: ./appPackage/manifest.json
outputZipPath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip
outputFolder: ./appPackage/build
# Validate app package using validation rules
- uses: teamsApp/validateAppPackage
with:
# Relative path to this file. This is the path for built zip file.
appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip
# Apply the Teams app manifest to an existing Teams app in
# Developer Portal.
# Will use the app id in manifest file to determine which Teams app to update.
- uses: teamsApp/update
with:
# Relative path to this file. This is the path for built zip file.
appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip
# Extend your Teams app to Outlook and the Microsoft 365 app
- uses: teamsApp/extendToM365
with:
# Relative path to the build app package.
appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip
# Write the information of created resources into environment file for
# the specified environment variable(s).
writeToEnvironmentFile:
titleId: M365_TITLE_ID
appId: M365_APP_ID
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# yaml-language-server: $schema=https://aka.ms/teams-toolkit/v1.8/yaml.schema.json
# Visit https://aka.ms/teamsfx-v5.0-guide for details on this file
# Visit https://aka.ms/teamsfx-actions for details on actions
version: v1.8

additionalMetadata:
sampleTag: Microsoft-Teams-Samples:tab-auth-entra-account-csharp

environmentFolderPath: ./env
Loading