Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JS] feat: Add enableSso property to toggle SSO in user auth scenarios #1232

Merged
merged 18 commits into from
Feb 2, 2024

Conversation

singhk97
Copy link
Collaborator

@singhk97 singhk97 commented Feb 2, 2024

Linked issues

closes: #1194 #991

Details

Introduced enableSso property in the OAuthSettings to toggle SSO in OAuth adaptive card, bot and message extension scenarios.

Change details

The authentication feature is broken down into these 3 scenarios, so I had to update these individual implementations for the enableSso property to work.

Bot auth

  • In bot auth, to disable sso you simply have to not include the tokenExchangeResource in the oauth card. The original OAuthPrompt didn't allow that so I had to create the OAuthBotPrompt to override the beginDialog method and sendOauthCard.

Message Extension auth

  • In ME auth, to disable sso you simply set the type to auth instead of silentAuth. I introduced a isSsoSignIn method to determine whether to use auth or not. This is because the card creation happens in the ME auth base class, which is used for TeamsSSO auth as well.

Adaptive Card auth

  • In adaptive card auth, to disable sso you simply don't include the tokenExchangeResource in the card.

Attestation Checklist

  • My code follows the style guidelines of this project

  • I have checked for/fixed spelling, linting, and other errors

  • I have commented my code for clarity

  • I have made corresponding changes to the documentation (updating the doc strings in the code is sufficient)

  • My changes generate no new warnings

  • I have added tests that validates my changes, and provides sufficient test coverage. I have tested with:

    • Local testing
    • E2E testing in Teams
  • New and existing unit tests pass locally with my changes

@singhk97 singhk97 requested review from a team, corinagum, aacebo and lilyydu as code owners February 2, 2024 04:08
@singhk97 singhk97 requested review from a team as code owners February 2, 2024 20:49
corinagum
corinagum previously approved these changes Feb 2, 2024
Copy link
Collaborator

@corinagum corinagum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@singhk97 singhk97 merged commit b8a7ffa into main Feb 2, 2024
5 checks passed
@singhk97 singhk97 deleted the kavin/enableSSo branch February 2, 2024 22:01
singhk97 added a commit that referenced this pull request Feb 7, 2024
#1236)

## Linked issues

closes: #1194 #991

## Details
* Corresponding JS PR: #1232 for implementation details.

## Attestation Checklist

- [x] My code follows the style guidelines of this project

- I have checked for/fixed spelling, linting, and other errors
- I have commented my code for clarity
- I have made corresponding changes to the documentation (updating the
doc strings in the code is sufficient)
- My changes generate no new warnings
- I have added tests that validates my changes, and provides sufficient
test coverage. I have tested with:
  - Local testing
  - E2E testing in Teams
- New and existing unit tests pass locally with my changes

---------

Co-authored-by: Corina <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Add the ability to enable or disable SSO in User Authentication
2 participants