Description
openedon Mar 30, 2020
Is your feature request related to a problem? Please describe.
OAuthPrompt
allows you to use a custom activity as the prompt by passing in PromptOptions.Prompt
. But if you don't pass in an activity with a SigninCard
or OAuthCard
attachment, then OAuthPrompt
injects its own card depending on the channel.
This causes issues if you want to prompt with a different type of card, such as an adaptive card. For example on Teams if I pass an activity with an adaptive card, OAuthPrompt
also injects a SigninCard
, resulting in a bad user experience.
Describe the solution you'd like
I want to be able to give OAuthPrompt
any kind of activity/cards for prompting. Maybe a way to tell it "I'm providing my own prompt, don't mess with my attachments."
Describe alternatives you've considered
- Send the adaptive card without a sign-in button and let
OAuthPrompt
send just the sign-in button as a separate activity- Downside: Looks bad since it renders as 2 separate cards (in Teams anyway).
- Downside:
OAuthPrompt
won't send the button if there's already a user token. We also have to figure out whether or not to send our adaptive card with an additional user token check.
- Write middleware to inspect outgoing activities and remove all
SigninCard
andOAuthCard
(assuming we don't ever want to use those cards)- Downside:
OAuthPrompt
does unnecessary work to create its card, including (I think) HTTP calls - Downside: Additional code, kind of hack-y, etc.
- Downside:
- Derive a class from
OAuthPrompt
that overridesBeginDialogAsync
to 1) inject a dummySigninCard
to preventOAuthPrompt
from doing extra work, and 2) set anOnSendActivities
handler to remove the outgoingSigninCard
, before calling the baseBeginDialogAsync
.- Downside: Additional code, kind of hack-y, etc.
[enhancement]