Skip to content

OAuthPrompt forces use of OAuthCard/SigninCard, which limits auth UX #3644

Open

Description

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 and OAuthCard (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.
  • Derive a class from OAuthPrompt that overrides BeginDialogAsync to 1) inject a dummy SigninCard to prevent OAuthPrompt from doing extra work, and 2) set an OnSendActivities handler to remove the outgoing SigninCard, before calling the base BeginDialogAsync.
    • Downside: Additional code, kind of hack-y, etc.

[enhancement]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Area: AuthenticationThe issue is related to authenticating users (SSO, OAuth, etc.)backlogThe issue is out of scope for the current iteration but it will be evaluated in a future release.feature-requestA request for new functionality or an enhancement to an existing one.needs-triageThe issue has just been created and it has not been reviewed by the team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions