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

Alexandre 351 Reputation points MVP
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 | Development
Microsoft Teams | Development
Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs
Microsoft Security | Microsoft Graph
Microsoft Teams | Microsoft Teams for business | Other
{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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.