PowerApps SPFX WebPart in Teams - Login issue in Teams Client

%3CLINGO-SUB%20id%3D%22lingo-sub-2048380%22%20slang%3D%22en-US%22%3EPowerApps%20SPFX%20WebPart%20in%20Teams%20-%20Login%20issue%20in%20Teams%20Client%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2048380%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20a%20customer%20I've%20created%20a%20SPFX%20webpart%20which%20shows%20a%20PowerApp%20using%20an%20iframe%20containing%20the%20PowerApp%20weblink.%20This%20works%20great%20in%20a%20browser%20scenario%2C%20but%20the%20teams%20client%20has%20a%20login%20issue.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20loading%20the%20personal%20app%20in%20Teams%20the%20power%20app%20loads%20but%20shows%20a%20sign%20in%20button%20(which%20is%20ok).%20When%20clicking%20the%20sign%20in%20button%2C%20a%20browser%20is%20opened%20and%20the%20user%20is%20logged%20in.%20Issue%20is%20the%20user%20won't%20be%20redirected%20back%20to%20teams%2C%20but%20the%20browser%20remains%20opened%20and%20loads%20the%20power%20app.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAlready%20tried%20to%20add%20the%20source%3Dteamstab%2C%20result%20is%20different%20behavior%20of%20the%20sign%20in%20button.%20In%20the%20end%20this%20results%20in%3CEM%3E%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2F%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fapps.powerapps.com%2Fteams%2Fauth%2Fend%23access_token%3D%3CACCESSTOKEN%3E%3C%2FACCESSTOKEN%3E%3C%2FA%3E%3C%2FEM%3E%26nbsp%3Bbeing%20visible%20in%20the%20browser%20and%20then%20nothing%20happens.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20way%20to%20make%20the%20PowerApp%20working%20in%20this%20SPFX%20scenario%20in%20the%20Teams%20Client%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAlso%20explored%20the%20(preview)%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F41501%22%20target%3D%22_blank%22%3E%40microsoft%3C%2FA%3E%2Fpowerappsplayersdk%20which%20basically%20results%20in%20the%20same%20outcome.%20The%20SDK%20also%20provides%20a%20getAccessToken%20method%20in%20which%20obtaining%20access%20tokens%20for%20resources%20can%20be%20implemented%20within%20the%20webpart%2C%20which%20in%20the%20end%20bypasses%20the%20sign%20in%20button%2C%20however%20this%20means%20ending%20up%20configuring%20a%20lot%20of%20permissions%20on%20the%20SPFX%20principal%20in%20Azure%20AD%20when%20using%20the%20SPFX%20TokenProvider.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2048380%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor

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) @microsoft/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.

1 Reply