-
Notifications
You must be signed in to change notification settings - Fork 802
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1210 from OfficeDev/v-hrajandira/CsharpToolkitMig…
…rationPR2 PR 2 - Implement toolkit csharp samples
- Loading branch information
Showing
57 changed files
with
1,594 additions
and
134 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
...bot-conversation-sso-quickstart/csharp_dotnetcore/BotConversationSsoQuickstart/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# TeamsFx files | ||
build | ||
AppManifest/build | ||
env/.env.*.user | ||
env/.env.local | ||
appsettings.Development.json | ||
.deployment | ||
|
||
# User-specific files | ||
*.user | ||
|
||
# Build results | ||
[Dd]ebug/ | ||
[Dd]ebugPublic/ | ||
[Rr]elease/ | ||
[Rr]eleases/ | ||
x64/ | ||
x86/ | ||
bld/ | ||
[Bb]in/ | ||
[Oo]bj/ | ||
[Ll]og/ | ||
|
||
# Notification local store | ||
.notification.localstore.json |
10 changes: 0 additions & 10 deletions
10
...quickstart/csharp_dotnetcore/BotConversationSsoQuickstart/AppManifest/README.md
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 20 additions & 19 deletions
39
...-quickstart/csharp_dotnetcore/BotConversationSsoQuickstart/Properties/launchSettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,28 @@ | ||
{ | ||
"iisSettings": { | ||
"windowsAuthentication": false, | ||
"anonymousAuthentication": true, | ||
"iisExpress": { | ||
"applicationUrl": "http://localhost:3978/", | ||
"sslPort": 0 | ||
} | ||
}, | ||
{ | ||
"profiles": { | ||
"IIS Express": { | ||
"commandName": "IISExpress", | ||
"launchBrowser": true, | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
}, | ||
"AuthenticationBot": { | ||
// Debug project within Teams | ||
"Microsoft Teams (browser)": { | ||
"commandName": "Project", | ||
"dotnetRunMessages": true, | ||
"launchBrowser": true, | ||
"launchUrl": "https://teams.microsoft.com/l/app/%TEAMSAPPID%?installAppPackage=true&webjoin=true&appTenantId=%TENANTID%&login_hint=%USERNAME%", | ||
"applicationUrl": "https://localhost:7130;http://localhost:5130", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
}, | ||
"applicationUrl": "http://localhost:3978/" | ||
"hotReloadProfile": "aspnetcore" | ||
} | ||
//// Uncomment following profile to debug project only (without launching Teams) | ||
//, | ||
//"Start Project (not in Teams)": { | ||
// "commandName": "Project", | ||
// "dotnetRunMessages": true, | ||
// "launchBrowser": true, | ||
// "applicationUrl": "https://localhost:7130;http://localhost:5130", | ||
// "environmentVariables": { | ||
// "ASPNETCORE_ENVIRONMENT": "Development" | ||
// }, | ||
// "hotReloadProfile": "aspnetcore" | ||
//} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
...versation-sso-quickstart/csharp_dotnetcore/BotConversationSsoQuickstart/aad.manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
{ | ||
"id": "${{AAD_APP_OBJECT_ID}}", | ||
"appId": "${{AAD_APP_CLIENT_ID}}", | ||
"name": "bot-conversation-sso-quickstart-aad", | ||
"accessTokenAcceptedVersion": 2, | ||
"signInAudience": "AzureADMultipleOrgs", | ||
"oauth2AllowIdTokenImplicitFlow": true, | ||
"oauth2AllowImplicitFlow": true, | ||
"optionalClaims": { | ||
"idToken": [], | ||
"accessToken": [ | ||
{ | ||
"name": "idtyp", | ||
"source": null, | ||
"essential": false, | ||
"additionalProperties": [] | ||
} | ||
], | ||
"saml2Token": [] | ||
}, | ||
"requiredResourceAccess": [ | ||
{ | ||
"resourceAppId": "Microsoft Graph", | ||
"resourceAccess": [ | ||
{ | ||
"id": "User.Read", | ||
"type": "Scope" | ||
} | ||
] | ||
} | ||
], | ||
"oauth2Permissions": [ | ||
{ | ||
"adminConsentDescription": "Allows Teams to call the app's web APIs as the current user.", | ||
"adminConsentDisplayName": "Teams can access app's web APIs", | ||
"id": "${{AAD_APP_ACCESS_AS_USER_PERMISSION_ID}}", | ||
"isEnabled": true, | ||
"type": "User", | ||
"userConsentDescription": "Enable Teams to call this app's web APIs with the same rights that you have", | ||
"userConsentDisplayName": "Teams can access app's web APIs and make requests on your behalf", | ||
"value": "access_as_user" | ||
} | ||
], | ||
"preAuthorizedApplications": [ | ||
{ | ||
"appId": "1fec8e78-bce4-4aaf-ab1b-5451cc387264", | ||
"permissionIds": [ | ||
"${{AAD_APP_ACCESS_AS_USER_PERMISSION_ID}}" | ||
] | ||
}, | ||
{ | ||
"appId": "5e3ce6c0-2b1f-4285-8d4b-75ee78787346", | ||
"permissionIds": [ | ||
"${{AAD_APP_ACCESS_AS_USER_PERMISSION_ID}}" | ||
] | ||
}, | ||
{ | ||
"appId": "d3590ed6-52b3-4102-aeff-aad2292ab01c", | ||
"permissionIds": [ | ||
"${{AAD_APP_ACCESS_AS_USER_PERMISSION_ID}}" | ||
] | ||
}, | ||
{ | ||
"appId": "00000002-0000-0ff1-ce00-000000000000", | ||
"permissionIds": [ | ||
"${{AAD_APP_ACCESS_AS_USER_PERMISSION_ID}}" | ||
] | ||
}, | ||
{ | ||
"appId": "bc59ab01-8403-45c6-8796-ac3ef710b3e3", | ||
"permissionIds": [ | ||
"${{AAD_APP_ACCESS_AS_USER_PERMISSION_ID}}" | ||
] | ||
}, | ||
{ | ||
"appId": "0ec893e0-5785-4de6-99da-4ed124e5296c", | ||
"permissionIds": [ | ||
"${{AAD_APP_ACCESS_AS_USER_PERMISSION_ID}}" | ||
] | ||
}, | ||
{ | ||
"appId": "4765445b-32c6-49b0-83e6-1d93765276ca", | ||
"permissionIds": [ | ||
"${{AAD_APP_ACCESS_AS_USER_PERMISSION_ID}}" | ||
] | ||
}, | ||
{ | ||
"appId": "4345a7b9-9a63-4910-a426-35363201d503", | ||
"permissionIds": [ | ||
"${{AAD_APP_ACCESS_AS_USER_PERMISSION_ID}}" | ||
] | ||
} | ||
], | ||
"identifierUris":[ | ||
"api://botid-${{AAD_APP_CLIENT_ID}}" | ||
], | ||
"replyUrlsWithType":[ | ||
{ | ||
"url": "https://${{BOT_DOMAIN}}/auth-end.html", | ||
"type": "Web" | ||
}, | ||
{ | ||
"url": "https://token.botframework.com/.auth/web/redirect", | ||
"type": "Web" | ||
} | ||
] | ||
} |
10 changes: 10 additions & 0 deletions
10
...conversation-sso-quickstart/csharp_dotnetcore/BotConversationSsoQuickstart/env/.env.local
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# 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 | ||
APP_NAME_SUFFIX=local | ||
|
||
# Generated during provision, you can also add your own variables. | ||
BOT_ID= | ||
TEAMS_APP_ID= | ||
BOT_DOMAIN= |
76 changes: 76 additions & 0 deletions
76
...versation-sso-quickstart/csharp_dotnetcore/BotConversationSsoQuickstart/infra/azure.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
@maxLength(20) | ||
@minLength(4) | ||
@description('Used to generate names for all resources in this file') | ||
param resourceBaseName string | ||
|
||
@maxLength(42) | ||
param botDisplayName string | ||
|
||
param botServiceName string = resourceBaseName | ||
param botServiceSku string = 'F0' | ||
param botAadAppClientId string | ||
param botAppDomain string | ||
|
||
param aadAppClientId string | ||
@secure() | ||
param aadAppClientSecret string | ||
param microsoftAppType string | ||
param microsoftAppTenantId string | ||
|
||
// Register your web service as a bot with the Bot Framework | ||
resource botService 'Microsoft.BotService/botServices@2021-03-01' = { | ||
kind: 'azurebot' | ||
location: 'global' | ||
name: botServiceName | ||
properties: { | ||
displayName: botDisplayName | ||
endpoint: 'https://${botAppDomain}/api/messages' | ||
msaAppId: botAadAppClientId | ||
msaAppType: microsoftAppType | ||
msaAppTenantId: microsoftAppType == 'SingleTenant' ? microsoftAppTenantId : '' | ||
} | ||
sku: { | ||
name: botServiceSku | ||
} | ||
} | ||
|
||
// Connect the bot service to Microsoft Teams | ||
resource botServiceMsTeamsChannel 'Microsoft.BotService/botServices/channels@2021-03-01' = { | ||
parent: botService | ||
location: 'global' | ||
name: 'MsTeamsChannel' | ||
properties: { | ||
channelName: 'MsTeamsChannel' | ||
} | ||
} | ||
|
||
resource botServiceConnection 'Microsoft.BotService/botServices/connections@2021-03-01' = { | ||
parent: botService | ||
name: 'oauthbotsetting' | ||
location: 'global' | ||
properties: { | ||
serviceProviderDisplayName: 'Azure Active Directory v2' | ||
serviceProviderId: '30dd229c-58e3-4a48-bdfd-91ec48eb906c' | ||
scopes: 'User.Read' | ||
parameters: [ | ||
{ | ||
key: 'clientId' | ||
value: aadAppClientId | ||
} | ||
{ | ||
key: 'clientSecret' | ||
value: aadAppClientSecret | ||
} | ||
{ | ||
key: 'tenantID' | ||
value: microsoftAppTenantId | ||
} | ||
{ | ||
key: 'tokenExchangeUrl' | ||
value: 'api://botid-${aadAppClientId}' | ||
} | ||
] | ||
} | ||
} | ||
|
||
output CONNECTION_NAME string = botServiceConnection.name |
30 changes: 30 additions & 0 deletions
30
...sso-quickstart/csharp_dotnetcore/BotConversationSsoQuickstart/infra/azure.parameters.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"resourceBaseName": { | ||
"value": "bot${{RESOURCE_SUFFIX}}" | ||
}, | ||
"botAadAppClientId": { | ||
"value": "${{AAD_APP_CLIENT_ID}}" | ||
}, | ||
"botAppDomain": { | ||
"value": "${{BOT_DOMAIN}}" | ||
}, | ||
"botDisplayName": { | ||
"value": "bot-conversation-sso-quickstart" | ||
}, | ||
"aadAppClientId": { | ||
"value": "${{AAD_APP_CLIENT_ID}}" | ||
}, | ||
"aadAppClientSecret": { | ||
"value": "${{SECRET_AAD_APP_CLIENT_SECRET}}" | ||
}, | ||
"microsoftAppType": { | ||
"value": "${{MICROSOFT_APP_TYPE}}" | ||
}, | ||
"microsoftAppTenantId": { | ||
"value": "${{MICROSOFT_APP_TENANT_ID}}" | ||
} | ||
} | ||
} |
Oops, something went wrong.