How to avoid errors in the authentication pop-up when using the mgt Teams Provider ?

Alexandre 351 Reputation points
2020-11-10T08:06:09.917+00:00

I am building a Teams tab using the Microsoft Graph Toolkit with Teams Provider in a React.js application.

The page corresponding to my tab is the following :

import React from "react";  
import { Providers, TeamsProvider } from '@microsoft/mgt';  
import * as microsoftTeams from "@microsoft/teams-js";  
  
// Set up Teams Provider for ms graph  
TeamsProvider.microsoftTeamsLib = microsoftTeams;  
Providers.globalProvider = new TeamsProvider({  
    clientId: '*-*-*-*-*',  
    authPopupUrl: 'https://*.eu.ngrok.io/auth'  
})  
  
// Define custom mgt elements as intrinsic JSX elements to avoid tsx errors  
declare global {  
    // eslint-disable-next-line @typescript-eslint/no-namespace  
    namespace JSX {  
        interface IntrinsicElements {  
            'mgt-login': any;  
        }  
    }  
}  
  
const MgtTab: React.FC = () => {  
    return (  
        <div>  
            <mgt-login></mgt-login>  
            <h1>Test from content</h1>  
        </div>  
    )  
}  
  
export default MgtTab;  

The authentication page is the following:

import React from 'react';  
import * as microsoftTeams from "@microsoft/teams-js";  
import {TeamsProvider} from '@microsoft/mgt';   
  
  
const Auth: React.FC =  () =>  {  
    TeamsProvider.microsoftTeamsLib = microsoftTeams;  
    TeamsProvider.handleAuth();  
    return (  
        <>  
        </>  
    )  
}  
  
export default Auth;  

When I click on the sign-in button on my tab page I have one the following errors:
38677-error-1.png

38713-error-2.png

It seems my application registration is correctly configured:
38558-configuration-azuread.png

Does anyone see what am I doing wrong and what could explain the errors I have ?

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,102 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,015 questions
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,251 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Manish-MSFT 256 Reputation points
    2020-11-12T05:01:42.583+00:00

    @Alexandre : We are investigating this internally.

    1 person found this answer helpful.

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.