Skip to content

Commit

Permalink
Changes for multi-hub-support for app. (OfficeDev#591)
Browse files Browse the repository at this point in the history
* Changes for multi-hub-support for app.

* Update ApplicationSettings.cs

Co-authored-by: Harikrishnan Rajandiran <[email protected]>
  • Loading branch information
ChetanSharma-msft and Harikrishnan-MSFT authored Dec 2, 2022
1 parent 665b68c commit e6ab5ca
Show file tree
Hide file tree
Showing 303 changed files with 3,257 additions and 410 deletions.
Binary file added samples/app-auth/nodejs/Images/AppOffice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/app-auth/nodejs/Images/AppOutlook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/app-auth/nodejs/Images/InstallOffice.png
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.
Binary file added samples/app-auth/nodejs/Images/InstallOutlook.png
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.
Binary file added samples/app-auth/nodejs/Manifest_Hub/color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 66 additions & 0 deletions samples/app-auth/nodejs/Manifest_Hub/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.13/MicrosoftTeams.schema.json",
"manifestVersion": "1.13",
"version": "1.0",
"id": "<<<REGISTERED_BOT_ID>>",
"packageName": "com.microsoft.teams.samples.auth",
"developer": {
"name": "Your Name Here",
"websiteUrl": "https://<<BASE_URI_DOMAIN>>",
"privacyUrl": "https://<<BASE_URI_DOMAIN>>/PrivacyStatement",
"termsOfUseUrl": "https://<<BASE_URI_DOMAIN>>/TermsOfUse"
},
"name": {
"short": "Teams AuthBot"
},
"description": {
"short": "Authentication sample for Microsoft Teams",
"full": "Authentication sample for Microsoft Teams"
},
"icons": {
"outline": "outline.png",
"color": "color.png"
},
"accentColor": "#F3F4F6",
"configurableTabs": [

],
"staticTabs": [
{
"contentUrl": "https://<<BASE_URI_DOMAIN>>/tab/simple",
"entityId": "simpleAuth",
"name": "Simple Auth",
"scopes": [
"personal"
]
},
{
"contentUrl": "https://<<BASE_URI_DOMAIN>>/tab/silent?loginHint={loginHint}&userObjectId={userObjectId}&tenantId={tid}",
"entityId": "silentAuth",
"name": "Silent Auth",
"scopes": [
"personal"
]
},
{
"contentUrl": "https://<<BASE_URI_DOMAIN>>/tab/sso",
"entityId": "ssoAuth",
"name": "SSO Auth",
"scopes": [
"personal"
]
}
],
"permissions": [
"messageTeamMembers",
"identity"
],
"validDomains": [
"<<BASE_URI_DOMAIN>>",
"token.botframework.com"
],
"webApplicationInfo": {
"id": "<<<REGISTERED_BOT_ID>>",
"resource": "api://<<BASE_URI_DOMAIN>>/<<<REGISTERED_BOT_ID>>"
}
}
178 changes: 118 additions & 60 deletions samples/app-auth/nodejs/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion samples/app-auth/nodejs/manifest/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.12/MicrosoftTeams.schema.json",
"manifestVersion": "1.12",
"version": "1.0",
"id": "00000000-0000-0000-0000-000000000000",
"id": "<<REGISTERED_BOT_ID>>",
"packageName": "com.microsoft.teams.samples.auth",
"developer": {
"name": "Your Name Here",
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.13/MicrosoftTeams.schema.json",
"manifestVersion": "1.13",
"version": "1.0.0",
"id": "{{Microsoft-App-Id}}",
"packageName": "com.microsoft.teams.appcompleteauth",
"developer": {
"name": "Microsoft",
"websiteUrl": "https://example.azurewebsites.net",
"privacyUrl": "https://example.azurewebsites.net/privacy",
"termsOfUseUrl": "https://example.azurewebsites.net/termsofuse"
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"name": {
"short": "App complete auth"
},
"description": {
"short": "Authentication sample for Microsoft Teams",
"full": "Authentication sample for Microsoft Teams"
},
"accentColor": "#FFFFFF",
"staticTabs": [
{
"contentUrl": "https://{{Base_URL_Domain}}/tab",
"entityId": "Auth",
"name": "Auth",
"scopes": [
"personal"
]
}
],
"composeExtensions": [
{
"botId": "{{Microsoft-App-Id}}",
"canUpdateConfiguration": true,
"commands": [
{
"id": "searchQuery",
"type": "query",
"title": "Search",
"description": "Perform a search",
"initialRun": true,
"fetchTask": false,
"context": [
"commandBox",
"compose"
],
"parameters": [
{
"name": "searchQuery",
"title": "Search",
"description": "Your search query",
"inputType": "text"
}
]
},
{
"id": "SSO",
"type": "action",
"title": "AAD SSO authentication",
"description": "SSO authentication",
"initialRun": false,
"fetchTask": true,
"context": [
"commandBox",
"compose"
]
},
{
"id": "FacebookLogin",
"description": "Sign in to facebook",
"title": "Facebook login (OAuth 2)",
"type": "action",
"fetchTask": true,
"context": [
"commandBox",
"compose"
]
},
{
"id": "UserCredentials",
"description": "Sign in using user credentials",
"title": "User Id/password login",
"type": "action",
"fetchTask": true,
"context": [
"commandBox",
"compose"
]
}
],
"messageHandlers": [
{
"type": "link",
"value": {
"domains": [
"*.botframework.com",
"https://{{Base_URL_Domain}}"
]
}
}
]
}
],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": [
"{Base_URL_Domain}"
],
"webApplicationInfo": {
"id": "{{Microsoft-App-Id}}",
"resource": "api://{{Base_URL_Domain}}/botid-{{Microsoft-App-Id}}"
}
}
62 changes: 57 additions & 5 deletions samples/app-complete-auth/csharp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Using this C# sample, you can check authenticate in bot,tab and messaging extent

## Prerequisites

- [.NET Core SDK](https://dotnet.microsoft.com/download) version 3.1
- [.NET Core SDK](https://dotnet.microsoft.com/download) version 6.0

```bash
# determine dotnet version
Expand Down Expand Up @@ -61,6 +61,11 @@ Using this C# sample, you can check authenticate in bot,tab and messaging extent
11. In the **Authorized client applications** section, identify the applications that you want to authorize for your app’s web application. Each of the following IDs needs to be entered:
* `1fec8e78-bce4-4aaf-ab1b-5451cc387264` (Teams mobile/desktop application)
* `5e3ce6c0-2b1f-4285-8d4b-75ee78787346` (Teams web application)
**Note** If you want to test or extend your Teams apps across Office and Outlook, kindly add below client application identifiers while doing Azure AD app registration in your tenant:
* `4765445b-32c6-49b0-83e6-1d93765276ca` (Office web)
* `0ec893e0-5785-4de6-99da-4ed124e5296c` (Office desktop)
* `bc59ab01-8403-45c6-8796-ac3ef710b3e3` (Outlook web)
* `d3590ed6-52b3-4102-aeff-aad2292ab01c` (Outlook desktop)
12. Navigate to **API Permissions**, and make sure to add the follow permissions:
- Select Add a permission
-  Select Microsoft Graph -\> Delegated permissions.
Expand Down Expand Up @@ -136,16 +141,18 @@ Using this C# sample, you can check authenticate in bot,tab and messaging extent

### 4. Setup Manifest for Teams

1. Modify the `manifest.json` in the `/AppPackage` folder and replace the following details:
1. Modify the `manifest.json` in the `/AppManifest` folder and replace the following details:
- `{{Microsoft-App-Id}}` with Application id generated from Step 3
- `{Base_URL_Domain}` - Your application's base url domain. E.g. for https://12345.ngrok.io the base url domain will be 12345.ngrok.io if you are using ngrok.

2. Zip the contents of `AppPackage` folder into a `manifest.zip`, and use the `manifest.zip` to deploy in app store or add to Teams.
**Note:** If you want to test your app across multi hub like: Outlook/Office.com, please update the `manifest.json` in the `app-complete-auth\csharp\AppCompleteAuth\Manifest_Hub` folder with the required values.

2. Zip up the contents of the `AppManifest` folder to create a `manifest.zip` or `Manifest_Hub` folder into a `Manifest_Hub.zip`. (Make sure that zip file does not contains any subfolder otherwise you will get error while uploading your .zip package)

3. Upload the manifest.zip to Teams (in the Apps view click "Upload a custom app")
- Go to Microsoft Teams and then go to side panel, select Apps
- Choose Upload a custom App
- Go to your project directory, the ./AppPackage folder, select the zip folder, and choose Open.
- Go to your project directory, the ./AppManifest folder, select the zip folder, and choose Open.
- Select Add in the pop-up dialog box. Your app is uploaded to Teams.

- Note: To test facebook auth flow please setup the sample locally as due to limitations from facebook you cannot test the facebook auth flow in the deployed version of app.
Expand Down Expand Up @@ -225,6 +232,50 @@ Messaging Extention Authentication

![ME Link unfurling using credentials details](AppCompleteAuth/Images/user-unfurl.png)

## Outlook on the web

- To view your app in Outlook on the web.

- Go to [Outlook on the web](https://outlook.office.com/mail/)and sign in using your dev tenant account.

**On the side bar, select More Apps. Your sideloaded app title appears among your installed apps**

![InstallOutlook](AppCompleteAuth/Images/InstallOutlook.png)

**Select your app icon to launch and preview your app running in Outlook on the web**

![AppOutlook](AppCompleteAuth/Images/AppOutlook.png)

![InstallOutlookSSOAuth](AppCompleteAuth/Images/InstallOutlookSSOAuth.png)

![InstallOutlookSignIn](AppCompleteAuth/Images/InstallOutlookSignIn.png)

![InstallOutlookSSOAuth](AppCompleteAuth/Images/InstallOutlookSSOAuth.png)

**Note:** Similarly, you can test your application in the Outlook desktop app as well.

## Office on the web

- To preview your app running in Office on the web.

- Log into office.com with test tenant credentials

**Select the Apps icon on the side bar. Your sideloaded app title appears among your installed apps**

![InstallOffice](AppCompleteAuth/Images/InstallOffice.png)

**Select your app icon to launch your app in Office on the web**

![AppOffice](AppCompleteAuth/Images/AppOffice.png)

![InstallOfficeSSOAUth](AppCompleteAuth/Images/InstallOfficeSSOAUth.png)

![InstallOfficeSignIn](AppCompleteAuth/Images/InstallOfficeSignIn.png)

![InstallOfficeSignInUSer](AppCompleteAuth/Images/InstallOfficeSignInUSer.png)

**Note:** Similarly, you can test your application in the Office 365 desktop app as well.

## Deploy the bot to Azure

To learn more about deploying a bot to Azure, see [Deploy your bot to Azure](https://aka.ms/azuredeployment) for a complete list of deployment instructions.
Expand All @@ -233,4 +284,5 @@ To learn more about deploying a bot to Azure, see [Deploy your bot to Azure](htt

- [Bot Framework Documentation](https://docs.botframework.com)
- [Bot Basics](https://docs.microsoft.com/azure/bot-service/bot-builder-basics?view=azure-bot-service-4.0)
- [Authentication basics](https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/authentication/authentication)
- [Authentication basics](https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/authentication/authentication)
- [Extend Teams apps across Microsoft 365](https://learn.microsoft.com/en-us/microsoftteams/platform/m365-apps/overview)
Loading

0 comments on commit e6ab5ca

Please sign in to comment.