예제 #1
0
        private async Task <DialogTurnResult> CreateNewAppAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
        {
            var tokenResponse = (TokenResponse)stepContext.Result;

            if (tokenResponse != null)
            {
                var client = new SimpleGraphClient(tokenResponse.Token);
                try
                {
                    var appBot = await client.RegisterNewApp("FAQPlusBotTest", "AzureADMultipleOrgs");

                    var secretsAppBot = await client.CreateNewPassword(appBot.Id);

                    var appConfig = await client.RegisterNewApp("FAQPlusConfigTest", "AzureADMyOrg");

                    var secretsAppConfig = await client.CreateNewPassword(appConfig.Id);

                    await stepContext.Context.SendActivityAsync($"Your app id is: {appBot.AppId}");
                }
                catch (System.Exception)
                {
                    throw;
                }
            }

            return(await stepContext.EndDialogAsync(cancellationToken : cancellationToken));
        }