We are facing an error while deploying a SharePoint application within the Microsoft Teams platform.
The application is built using the REACT (class components) + TypeScript + SPFX framework and is designed to display user-specific information such as meetings, calendar, and basic information.
We are required to call the graph API to fetch information, which requires an access token. To obtain this token, we are using "useMSAL" to get instance and accounts.
However, when we use "MsalAuthenticationTemplate interactionType={InteractionType.Redirect}," the following error occurs:
"Either Guest user or Cortex is not enabled!"
We have implemented the MSAL library for user authentication to use MS Graph APIs, and it works perfectly in SharePoint.
Still, it fails in MS Teams.
There are two methods for authenticating users, namely Popup & Redirect. If we use the Popup method, MS Teams shows that it cannot open the popup and may require an additional app.
If we use the redirect method, it does not redirect at all (only in MS Teams), and the user is not authenticated.
Can someone help us identify the root cause of this error and suggest possible solutions to fix it?
The exact error seen is as below :
sp-pages-assembly_en-us_70763d2ddd8945ddecd01003e22c52ba.js:70 Uncaught (in promise) Error: Either Guest user or Cortex is not enabled! at new t (sp-pages-assembly_en-us_70763d2ddd8945ddecd01003e22c52ba.js:70:2196389) at N (sp-pages-assembly_en-us_70763d2ddd8945ddecd01003e22c52ba.js:70:2196840) at t._tryRenderAnnotations (sp-pages-assembly_en-us_70763d2ddd8945ddecd01003e22c52ba.js:70:2220209) at a._handleCanvasViewportRendered (sp-pages-assembly_en-us_70763d2ddd8945ddecd01003e22c52ba.js:70:2199406) at sp-pages-assembly_en-us_70763d2ddd8945ddecd01003e22c52ba.js:70:1489731 at Set.forEach () at e._handleViewPortRendered (sp-pages-assembly_en-us_70763d2ddd8945ddecd01003e22c52ba.js:70:1489707) at e._tryLoadOutsideViewport (sp-pages-assembly_en-us_70763d2ddd8945ddecd01003e22c52ba.js:70:1489455) at e._onComponentFinish (sp-pages-assembly_en-us_70763d2ddd8945ddecd01003e22c52ba.js:70:1486557) at e.onAfterComponentRenderOrError