MS-Teams integration: sso not working in teams-tab giving error on getAuthToken: App resource defined in manifest and iframe origin do not match

Sumit Chauhan 0 Reputation points
2023-08-18T12:38:40.6066667+00:00

Hi

We are facing sso login issue on ms-teams tab app. We set up 2 account sone for dev and one for production. It is working on on our dev app. But not working for production app.

While trying to get token using function authentication.getAuthToken .. getting error message "App resource defined in manifest and iframe origin do not match"

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.
3,868 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Nivedipa-MSFT 3,626 Reputation points Microsoft External Staff
    2023-08-21T06:56:34.8766667+00:00

    The error message "App resource defined in manifest and iframe origin do not match" indicates that there is a mismatch between the app resource defined in your Teams app manifest and the origin of the iframe where your tab app is hosted.

    To resolve this issue, you need to ensure that the app resource defined in your Teams app manifest matches the origin of the iframe where your tab app is hosted. Here are the steps to fix this issue:

    1. Open your Teams app manifest file.
    2. Locate the webApplicationInfo section in the manifest file.
    3. Ensure that the id property in the webApplicationInfo section matches the origin of the iframe where your tab app is hosted. The origin should include the protocol (e.g., https://) and the domain name.
    4. Save the manifest file and update your Teams app with the new manifest.

    Here is an example of how the webApplicationInfo section should look like in your Teams app manifest:

    "webApplicationInfo": {
      "id": "https://your-tab-app-domain.com",
      "resource": "api://your-app-id"
    }
    

    Make sure to replace https://your-tab-app-domain.com with the actual origin of your tab app's iframe and api://your-app-id with the actual app ID of your Azure AD app.

    Ref Doc: https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/authentication/bot-sso-manifest

    Thanks,

    Nivedipa


    If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.