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.

AADSTS50058 - Unable authenticate on MS Teams Desktop App

See original GitHub issue

Core Library

MSAL.js v2 (@azure/msal-browser)

Core Library Version

2.26.0

Wrapper Library

Not Applicable

Wrapper Library Version

0

Description

Using template tab-aad-msal2

And upgrade

"@azure/msal-browser": "^2.26.0",
"@microsoft/teams-js": "^2.0.0",

this.msalClient.loginRedirect(this.request) working on Teams Web, but not working on Teams Desktop App

Error Message

InteractionRequiredAuthError: AADSTS50058: A silent sign-in request was sent but no user is signed in. The cookies used to represent the user's session were not sent in the request to Azure AD. This can happen if the user is using Internet Explorer or Edge, and the web app sending the silent sign-in request is in a different IE security zone than the Azure AD endpoint (login.microsoftonline.com). Trace ID: f6450045-e435-4fa7-8dcb-b1e7da7f2300 Correlation ID: b88afb3e-7b95-48fc-a68e-5875238dd1d3 Timestamp: 2021-01-28 08:56:59Z

Msal Logs

image

MSAL Configuration

const msalConfig = {
            auth: {
                clientId,
                authority,
                redirectUri
            },
            cache: {
                cacheLocation: "localStorage",
                storeAuthStateInCookie: false
            }
};

Relevant Code Snippets

this.msalClient.loginRedirect(this.request);

Reproduction Steps

  1. Login in Microsoft Teams Desktop App
  2. Select Tab
  3. Click Login
  4. Open devTool in Iframe Auth
  5. Observe

Expected Behavior

loginRedirect successfully.

Identity Provider

Azure AD / MSA

Browsers Affected (Select all that apply)

Chrome

Regression

No response

Source

External (Customer)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:27 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
tiennguyen1293commented, Aug 24, 2022

Many thanks team !!!

1reaction
jasonnuttercommented, Aug 18, 2022

Hi @derisen @jasonnutter

I’m understanding you are not sure about silently acquiring tokens will work on Teams Desktop App? For some reason, we still have to display a prompt to re-login again in the Teams Tab app.

I’m meaning Teams App => login => Tab App => get Token => re-login?

If you are not able to perform the OBO flow using the Teams SSO token (as shown in the sample) you can try invoking ssoSilent on page load to attempt to silently sign in. If that fails, you will need to invoke an interactive prompt.

So … Do we help update the DOC on this?

Just to clearly and for others to have the same question as me.

Yes, those docs should probably be updated. cc @EmLauber

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable authenticate on MS Teams Desktop App with MSAL v2
Reproduction Steps. Login in Microsoft Teams Desktop App; Select Tab; Click Login; Observe popup authenticate shown. Open devTool in Iframe Auth ...
Read more >
Teams silent login failure AADSTS50058 - Microsoft Community
AADSTS50058 : A silent sign-in request was sent but no user is signed in. ... Restart laptop, login on MS Team app and...
Read more >
Unable to run tab on MS Teams Desktop App - Stack Overflow
Invokes MSTeams App Api and trying to get token from there. ... IE security zone than the Azure AD endpoint (login.microsoftonline.com).
Read more >
Solved – AADSTS50058: A silent sign-in request was sent but ...
We might get below error while trying to login to Power Apps AADSTS50058: A silent sign-in request was sent but none of the...
Read more >
Resolving Common Teams Issues - Cornell University
This article applies to: Microsoft Teams ... The Teams app not launching properly and instead showing a ... Unable to log in to...
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