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)); }
private async Task <DialogTurnResult> CreateNewSecret(WaterfallStepContext stepContext, CancellationToken cancellationToken) { var tokenResponse = (TokenResponse)stepContext.Result; if (tokenResponse != null) { var client = new SimpleGraphClient(tokenResponse.Token); var app = await client.CreateNewPassword("10437c16-0e73-4971-9bba-9f5686009160"); await stepContext.Context.SendActivityAsync($"Your app id is: {app.SecretText}"); } return(await stepContext.EndDialogAsync(cancellationToken : cancellationToken)); }