microsoftTeams.authentication.getAuthToken() fails in pop out tab

Alexander Ágústsson 1 Reputation point
2022-08-24T11:36:33.917+00:00

I have a Teams tab app that is using SSO authentication and works well until users open it in pop-out mode. Then the call microsoftTeams.authentication.getAuthToken() fails with the error "Error: App resource defined in manifest and iframe origin do not match".
Is there a way to get the authentication token in a pop-out window?

Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
2,828 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sayali-MSFT 2,266 Reputation points Microsoft Vendor
    2022-08-25T12:30:59.1+00:00

    Tab SSO shows how to implement Azure AD single sign-on support for tabs.

    • Obtain an access token for the logged-in user using SSO
    • Call a web service - also part of this project - to exchange this access token
    • Call Graph and retrieve the user's profile
    • Bot, ME SSO Bot Framework v4 bot using Teams authentication

    The below sample app talks about the Teams Tab, Bot, ME - search, action, linkunfurl SSO with C#.

    Sample Link-https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/app-sso/csharp

    0 comments No comments