2

In my project, I am trying to use graph toolkit components (mgt-login and mgt-people-picker) inside a teams tab using mgt-msal-provider or mgt-teams-provider, but it doesn't seems to work. Any help is much appreciated.

Those components work as expected with mgt-mock-provider where authentication is not required.

<mgt-teams-provider client-id="Client-ID"
    auth-popup-url="auth.html"></mgt-teams-provider>

<mgt-msal-provider client-id="Client-ID"
    login-type="redirect/popup"
    scopes="user.read,people.read"
    authority=""></mgt-msal-provider>

<!--<mgt-mock-provider></mgt-mock-provider>-->
<mgt-login></mgt-login>
<mgt-people-picker></mgt-people-picker>

When I enable mgt-mock-provider, both mgt-login and mgt-people-picker controls are working as expected. I would like to make it work with either mgt-teams-provider or mgt-msal-provider

Note: I have replaced the original client-id value with "Client-ID" in the sample code snippet.

sj'
  • 43
  • 5
  • MSAL only supports the Implicit Flow for OAuth. Make sure to enable Implicit Flow in your application in the Azure Portal (it is not enabled by default). Under Authentication, find the Implicit grant section and select the checkboxes for Access tokens and ID tokens. – Trinetra-MSFT Nov 11 '19 at 05:07
  • Thanks Trinetra. I have already enabled the Implicit Flow in my application and selected both the check boxes ( Access tokens and ID tokens). I am able to populate People Picker control outside teams app (by accessing the control from the web application) but when I try to access the same web application inside teams tab, it is not showing any data. – sj' Nov 11 '19 at 05:12
  • Could you please attach your error response here so we can take a look? – Trinetra-MSFT Nov 14 '19 at 13:15
  • When I am using TeamsProvider for authentication, it get stuck in a redirect loop. May be it is related to the open issue - https://github.com/microsoftgraph/microsoft-graph-toolkit/issues/178 – sj' Nov 14 '19 at 22:33
  • 1
    We are tracking this internally, once fix will be rolled out we will let you know – Trinetra-MSFT Nov 15 '19 at 02:50
  • Can we use the beta version of MSAL to resolve this problem? – sj' Nov 29 '19 at 04:27
  • Beta version is subject to change anytime, I will not suggest you to use it for production. – Trinetra-MSFT Nov 29 '19 at 05:14

0 Answers0