question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Authentication conflict when signing in to Teams with a managed account and then signing in with a separate non-managed account

See original GitHub issue

Version

  • Bot dependency versions
    implementation 'com.microsoft.bot:bot-integration-spring:4.14.2'
    implementation 'com.microsoft.bot:bot-dialogs:4.14.2'
    
  • Windows 10
  • Microsoft Teams Version 1.5.00.12969 (64-bit)

Describe the bug

I’m having issues with Teams authentication using the incorrect account with my bot. That happens when I have an account that is “Managed” and then try to authenticate with the bot with a separate “unmanaged” account. If you have Account A which is managed and Account B which is not managed, when you login to the bot with Account B it uses the credentials of Account A instead. I can see the SSO window pops up quickly and closes down right away so I guess the SSO window sees that I have a single signed in managed account so it just uses it for convenience but it doesn’t check that it was the same account that triggered the authentication in the first place so the wrong account is used.

To Reproduce

Steps to reproduce the behavior:

  1. I sign in to Teams with an account A and use “Allow my organisation to manage my device” in order to stay signed in. I can only see this account if I go to Windows Settings > Accounts > Access work or school.
  2. Once I’m signed in with account A, I navigate into my app and attempt to sign in with my bot. Given SSO, a window pops open and closes right away. The sign in is successful.
  3. I then sign out from Teams (app is closed and re-opened) and sign in with another account (B) but for that account I use “No, sign in to this app only” option so that I don’t stay signed in (i.e. account is unmanaged). I do NOT see this account if I go to Windows Settings > Accounts > Access work or school (I only see Account A).
  4. Once I’m signed in with account B, I navigate into my app and attempt to sign in with my bot. Similar to step 2 above, a window pops open and closes right away. The sign in is successful BUT on my bot I can see that it was account A that was signed in and not account B.

Expected behavior

On step 4 above either one of these 2 options:

  • When the sign in attempt is triggered, the window pops open and stays open so that I can select which account I’d like to login.
  • When the sign in attempt is triggered, the current logged in account (account B) is used for SSO and not any other accounts.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

My bot has been implemented in a similar way as it’s described in the bot samples repo (46.teams-auth). There is no way as far as I know to force that the account that triggered the sign in (in the promptStep()) to be the same as the one that is returned in the loginStep().

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
anishprasad01commented, Jun 6, 2022

Hi @ClaudioConsolmagno,

Thanks for the report. I was able to reproduce this behavior. At this point, I’m going to look into it further and see if this is a Bot Framework SDK issue, a Teams issue, or expected behavior. Then we can figure out next steps.

0reactions
ClaudioConsolmagnocommented, Jun 9, 2022

Appreciate the help @anishprasad01 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Teams bot app authentication conflict when using Teams with ...
When user navigates to our app with account B and trigger login to the bot, the SSO window appears and disappears in less...
Read more >
Why am I having trouble signing in to Microsoft Teams?
The Windows credentials you signed in with are different than your Microsoft 365 credentials. Try to sign in again with the correct email/...
Read more >
Teams - work and personal account conflict
I have requested for the personal account under the same email address to be deleted ... Sign out from MS Teams app, and...
Read more >
Microsoft Teams won't allow me to sign in with another account
I had 3 different accounts working just fine until last week, then poof, something changed and one of them disappeared.
Read more >
Troubleshooting Azure Active Directory B2B collaboration
When this feature is turned off, the fallback authentication method is to prompt invitees to create a Microsoft account. Guest sign-in fails ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found