Open Digvijayrao-KF opened 1 year ago
@Digvijayrao-KF - Thanks for reporting your issue. We will check this at our end and will get back to you.
@Digvijayrao-KF - We are able to reproduce the issue with the @microsoft/teams-js library version 1.11.0. We have raised a bug for the same, and we will inform you once we receive any updates.
Meanwhile, we have tested this scenario with the latest TeamsJS library, and it is working fine.
Could you please try it with the latest @microsoft/teams-js version 2.15.0?
Even @microsoft/teams-js version 2.15.0 is having same behavior. On further digging into it I found the instance.setActiveAccount(account) method from @azure/msal-react is misbehaving.
const { instance, accounts } = useMsal();
instance.setActiveAccount(account);
const thereAreAccounts = !!accounts.length || !!instance.getAllAccounts().length; // evaluates to false
We are using @azure/msal-browser@2.22.1 and @azure/msal-react@1.3.1.
The same piece of code is working fine within Teams App(Both classic and new) it breaks only when we access the app using chrome browser. I suspect some restriction imposed/strict-policy change in the way chrome handles embedded iframes with the version starting 116.
Hello @kundan-kf - Thanks for sharing the information. We have informed engineering team and let you know if we have any updates.
While using the microsoftTeams method from @microsoft/teams-js, the code
microsoftTeams.authentication.notifySuccess(event)
receives the valid event object, Further in func onGetAuthTokenSuccess we are unable to get the length of active MSAL Account post setting it.Since 1st iteration fails in the below code we get event as undefined, and that breaks the rest of the MSAL authentication process.
The package versions used are listed below, "@azure/msal-browser": "^2.22.1", "@azure/msal-react": "^1.3.1", "@microsoft/signalr": "^6.0.8", "@microsoft/teams-js": "^1.11.0".
Note: We tried using different machines with Chrome browser version 116 onwards for accessing the app via url https://teams.microsoft.com, the issue is random (i.e some users are able to access the app via a particular credential, but others are facing issues for the same login details.). Also it occurs only on chrome browser for windows & mac users. Microsoft Edge works fine on cross platforms.
Could you please provide any possible solutions?