microsoftgraph / microsoft-graph-toolkit

Authentication Providers and UI components for Microsoft Graph 🦒
https://docs.microsoft.com/graph/toolkit/overview
Other
945 stars 303 forks source link

Peoplepicker fails without get tenant #3168

Closed raleec closed 5 months ago

raleec commented 5 months ago

Describe the bug We currently use components of the @microsft/mgt NPM package. However, it is an old version 2.3.1.
I am upgrading from Angular 12 to Angular 15, which requires me to upgrade several other npm packages.
@microsft/mgt is the only one that is giving a hard time. The peoplepicker should display users. However, the search option is now broken. I am getting a nasty error that is impossible to troubleshoot. "error\":{\"code\":\"OrganizationFromTenantGuidNotFound\",\"message\":\"The tenant for tenant guid 'Tenant-in-Non-commercial-Cloud' does not exist.\"

To Reproduce Steps to reproduce the behavior:

  1. Deploy application with peoplepicker in a non-commercial cloud
  2. Click on Peoplepicker component
  3. See error

Expected behavior I'd like the people picker to display people from the Graph

Environment (please complete the following information):

Additional context Add any other context about the problem here.

gavinbarron commented 5 months ago

What version of the mgt libraries are you trying to upgrade to, and do you have a minimal reproduction you can share?

raleec commented 5 months ago

What version of the mgt libraries are you trying to upgrade to, and do you have a minimal reproduction you can share?

Attempting to upgrade to the latest version. Working on a minimal reproduction.

raleec commented 5 months ago

Upgrading to the latest version in the 2.x range versions: MGT-PEOPLE-PICKER/2.11.2, MgtMsal2Provider/2.11.2, mgt/2.11.2, graph-js/2.2.1 (featureUsage=6)

url: https://graph.microsoft.us/v1.0/me/people?$search=%22hen%22&$top=10&$filter=personType/class%20eq%20%27Person%27

raleec commented 5 months ago

I found the error, and it wasn't related to this failed call. in short, the fix described here: https://github.com/microsoftgraph/microsoft-graph-toolkit/issues/1471 created a condition where the people picker defaults to person. the existing code required group.