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

[Bug]: [JS & dotnet] OAuth Connection based message extension auth does not work if not enable SSO #991

Closed
Tracked by #1102
blackchoey opened this issue Dec 1, 2023 · 3 comments
Assignees
Labels
bug Something isn't working dotnet Change/fix applies to dotnet. If all three, use the 'JS & dotnet & Python' label JS Change/fix applies to JS. If all three, use the 'JS & dotnet & Python' label

Comments

@blackchoey
Copy link
Contributor

Please note: any submissions with insufficient reproducible information will be marked as 'Waiting for customer input' and may be closed is there is no response

Describe the bug

If the Teams app manifest does not enable SSO (removing the webApplicationInfo field in the manifest), the OAuth Connection based message extension auth will not work.

To Reproduce

  1. Download https://github.com/microsoft/teams-ai/tree/main/js/samples/06.auth.oauth.messageExtension
  2. Remove webApplicationInfo filed in appPackage/manifest.json
  3. Debug the app
  4. Type profile to show user profile
  5. Message extension shows We didn't find any matches instead of displaying the sign in link

Expected behavior

The Message Extension should provide a link asking user to login.

Screenshots

image

Desktop(s) (please complete the following information):

  • OS: [e.g. macOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context

The root cause should be our library always use silentAuth for query command, which means using Teams SSO.
One idea to solve this is adding an EnableSSO setting to authentication settings so developer can control whether to use SSO.

@blackchoey blackchoey added the bug Something isn't working label Dec 1, 2023
@blackchoey blackchoey added dotnet Change/fix applies to dotnet. If all three, use the 'JS & dotnet & Python' label JS Change/fix applies to JS. If all three, use the 'JS & dotnet & Python' label labels Dec 1, 2023
@blackchoey blackchoey changed the title [Bug]: OAuth Connection based message extension auth does not work if not enable SSO [Bug]: [JS & dotnet] OAuth Connection based message extension auth does not work if not enable SSO Dec 1, 2023
@singhk97
Copy link
Collaborator

singhk97 commented Dec 3, 2023

@blackchoey The webApplicationInfo property is required for non-SSO scenarios as well. To enable SSO in OAuth connection is to set the token exchange url property. And to disable it, is to set it blank.

@blackchoey
Copy link
Contributor Author

@singhk97 I tried to set the resource property under webApplicationInfo to empty, as well as removed token exchange url from the OAuth Connection on Azure Bot Service, but still observed the same problem.

You can find my project at https://github.com/microsoft/teams-ai/tree/chyuan/issue-991-repro/js/samples/06.auth.oauth.messageExtension and refer 5238260 for the changes I have done.

singhk97 added a commit that referenced this issue 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]>
@singhk97
Copy link
Collaborator

singhk97 commented Feb 7, 2024

Implemented enableSso feature to toggle SSO in sign in flow. This feature should be available in the next minor releases.

@singhk97 singhk97 closed this as completed Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dotnet Change/fix applies to dotnet. If all three, use the 'JS & dotnet & Python' label JS Change/fix applies to JS. If all three, use the 'JS & dotnet & Python' label
Projects
None yet
Development

No branches or pull requests

2 participants