private async Task <DialogTurnResult> ProcessStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken) { var rawValues = (JObject)stepContext.Context.Activity.Value; var userProfile = (UserProfile)stepContext.Values[UserInfo]; userProfile.Domain = (string)rawValues.GetValue("Domain"); userProfile.UserPrincipalName = userProfile.DomainName + userProfile.Domain; Dictionary <string, object> args = (Dictionary <string, object>)stepContext.Options; string topScoringIntent = (string)args["topScoringIntent"]; TokenResponse tokenResponse = (TokenResponse)args["TokenResponse"]; if (topScoringIntent == "Get User") { Attachment cardAttachment = (Attachment)args["cardAttachment"]; await OAuthHelpers.GetUserAsync(stepContext.Context, tokenResponse, userProfile.UserPrincipalName); } else if (topScoringIntent == "Disable User") { await OAuthHelpers.DisableUserAsync(stepContext.Context, tokenResponse, userProfile.UserPrincipalName); } else if (topScoringIntent == "Enable User") { await OAuthHelpers.EnableUserAsync(stepContext.Context, tokenResponse, userProfile.UserPrincipalName); } return(await stepContext.EndDialogAsync(null, cancellationToken)); }