OfficeDev / microsoft-teams-library-js

JavaScript library for use by Microsoft Teams apps
https://docs.microsoft.com/microsoftteams/platform/
Other
426 stars 194 forks source link

Unexpected login popup triggered by app.initialize in New Outlook #2459

Open zumbuschms opened 1 month ago

zumbuschms commented 1 month ago

We are working on a Tab App to be added to all supported Outlook versions. The app accesses an on-prem web application via side loading the app into a Microsoft 365 tenant. As we need to support external OpenID Connect providers as well as Microsoft 365, we went for the authentication.authenticate approach and this works as expected. During initialization of our web application, we call app.initialize() and app.getContext() to retrieve the user's name as a hint for our login dialog.

Wenn calling app.initialize in New Outlook context, an Microsoft 365 login popup is shown which is unexpected, as we don't want to use signle sign on capabilities. Logging in using my Microsoft 365 credentials I get the following error message: image

This only occurs within New Outlook and not within legacy Outlook or Outlook on the Web.

Really confusing about the error message is that the IDs in the error message represent Outlook on the Web (bc59ab01-8403-45c6-8796-ac3ef710b3e3) and Office 365 Exchange Online (00000002-0000-0ff1-ce00-000000000000). Our web application does not access any Microsoft and just connects to our on-prem deployed backend application.

How do we get rid of the login prompt?

Our Environment:

Nivedipa-MSFT commented 1 month ago

@zumbuschms - Thanks for reporting your issue. We will check this and update you soon.

salaman commented 1 month ago

@zumbuschms I believe this was fixed last week. Can you try relaunching Outlook a few times to pick up the new version, and also include the "Client version" from the settings > general > about page if it hasn't fixed it?

zumbuschms commented 1 month ago

The issue still occurs and I only started to use New Outlook last week to test our app. My current version of New Outlook:

You have Microsoft Outlook Version 1.2024.725.400 (Production). Client Version is 20240802003.17. WebView2 Version is 127.0.2651.98.

salaman commented 3 weeks ago

We haven't been able to reproduce this issue internally. We have many apps that call app.initialize() successfully even if they are not configured for Tab SSO and I'm not seeing the prompting occur. That would happen if you're calling authentication.getAuthToken(...) to trigger a non-silent request -- can you share any code snippets or some minimal repro code that you know is, by itself, causing this prompt to show?

zumbuschms commented 2 weeks ago

I was able to reproduce the popup with a simple sample application in the latest New Outlook using TeamsJS 2.26.

Outlook Version: 1.2024.814.200 (Production) Client Version: 20240816003.13 WebView2 Version is 127.0.2651.105

I've attached a zip file with the sample app and a Dockerfile to host the app in nginx. app.zip. You need to place a certificate file (cert.crt) and its private key (cert.key) in the folder config/tls to be able to build and run the Docker container.

I also attached the manifest for the app: manifest.json

We can reproduce the issue on multiple systems wiht multiple MS365 tenants. The affected environments:

Common:

Env 1:

Env 2:

Env 3: