Forum Discussion
Can we place a cancel button next to the sign-in button in the sign-in prompt (OAuth prompt)
Hi Team,
Currently we ate using the below code and oauth prompt settings for using the MS delegated graph api permissions.
private async Task<DialogTurnResult> PromptStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
{
return await stepContext.BeginDialogAsync(nameof(OAuthPrompt), null, cancellationToken);
}
Can we add one more button Cancel for users if they are not interested to sign in. Currently we are handling by adding a custom message saying user to type 'cancel' if they don't want to continue sign in. But that's like an extra effort from user side.
Also, we have tried the below code,
public static OAuthCard GetOAuthCard()
{
var oauthCard = new OAuthCard
{
Text = "BotFramework OAuth Card",
ConnectionName = "OAuth connection", // Replace with the name of your Azure AD connection.
Buttons = new List<CardAction> { new CardAction(ActionTypes.Signin, "Sign In", value: "https://example.org/signin"), new CardAction(ActionTypes.ImBack, "Cancel") },
};
return oauthCard;
}
But this also didn't worked. We have sent this card as a text prompt attachment but sign in button didn't worked
- Meghana-MSFTMicrosoft
The OAuth prompt you're using follows a predefined process for handling OAuth authentication, hence it currently doesn't support adding custom buttons like "Cancel" next to the sign-in button as part of the OAuth flow.
- Lakshmi_145Brass Contributor
Meghana-MSFT, Thanks for the response,
Do we have any other option to add a cancel button along with Sign in. Can we use any adaptive card properties or hero card where we can use the oauth connection name so that sign in will work
- Meghana-MSFTMicrosoft
Lakshmi_145 - No currently it is not supported to use the oauth connection name for any other card except oAuthCard.