OfficeDev / Microsoft-Teams-Samples

Welcome to the Microsoft Teams samples repository. Here you will find task-focused samples in C#, JavaScript and TypeScript to help you get started with the Microsoft Teams App!
MIT License
1.02k stars 776 forks source link

bot-teams-authentication-python Teams Sign In Popup closing immediately (working in Webchat) #1364

Closed BriscoGit closed 3 weeks ago

BriscoGit commented 3 months ago

Hello!

I have been trying to integrate the SSO authentication into my Azure Bot using this repository as a guideline: [https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/bot-teams-authentication/python]

Unfortunately I have been stuck with an issue that is only occuring in Teams. The Bot will send me an adaptive card with a button to sign in: image Clicking on the button opens a popup window with a Microsoft Login screen. Logging in with my Microsoft account causes a new popup to open that contains the Verification Code for the authentication, which has to be pasted into the chat with the bot.

While this process works in the Webchat, in Teams this popup closes after 0.5-1s making it impossible to copy the code. Clicking again on the button shows this message: image (Sign-In Code is invalid or expired. Ask the bot to send a new sign in link)

I have been able to reproduce this issue in the Webchat by simply also closing the popup with the authentication code, causing the same error message to appear.

Can you look into this issue or is there a known fix?

Thank you! BR, Marvin

Steps to reproduce:

  1. Create new Bot Service in Azure
  2. Create Client secret
  3. Create Web URI with this link: https://token.botframework.com/.auth/web/redirect
  4. Create new OAuth connection in Azure Bot (Azure active directory or AADv2)
  5. Copy git repository into python IDE
  6. Install requirements.txt
  7. Adjust config.py with correct APP ID, PWD and connection name
  8. Adjust manifest.zip with correct APP ID and also validDomains
  9. Start devtunnel on Port 3978
  10. Copy devtunnel link into Azure bot endpoint
  11. Start app.py
  12. Open in Bot in Teams
  13. Write anything
  14. Click on Sign In Button
Meghana-MSFT commented 3 months ago

Thank you for reporting this, we will check this and get back to you.

Meghana-MSFT commented 1 month ago

@BriscoGit - We tested this sample at our end, and it is working fine. We did not get any verification code popup. Would it be possible for you to share a repro video of this?

BriscoGit commented 3 weeks ago

Hi, sorry for the late response!

Issue seems to have been fixed in the meanwhile. Its working in my environment now!

Thank you for your time.

BriscoGit commented 3 weeks ago

Done