PowerApps SPFX WebPart in Teams - Login issue in Teams Client

Copper Contributor

Hi,

 

For a customer I've created a SPFX webpart which shows a PowerApp using an iframe containing the PowerApp weblink. This works great in a browser scenario, but the teams client has a login issue.

 

When loading the personal app in Teams the power app loads but shows a sign in button (which is ok). When clicking the sign in button, a browser is opened and the user is logged in. Issue is the user won't be redirected back to teams, but the browser remains opened and loads the power app.

 

Already tried to add the source=teamstab, result is different behavior of the sign in button. In the end this results in https://apps.powerapps.com/teams/auth/end#access_token=<accesstoken> being visible in the browser and then nothing happens.

 

Is there a way to make the PowerApp working in this SPFX scenario in the Teams Client?

 

Also explored the (preview) @Pernille-Eskebo/powerappsplayersdk which basically results in the same outcome. The SDK also provides a getAccessToken method in which obtaining access tokens for resources can be implemented within the webpart, which in the end bypasses the sign in button, however this means ending up configuring a lot of permissions on the SPFX principal in Azure AD when using the SPFX TokenProvider.

2 Replies
It is of course about authentication. It would be better to have the SharePoint page as app in a different app and the PowerApp as a separate Teams app. That way the SSO can be set to both separately.

to answer the question: I am not sure it can be fixed but I am not a dev here.