SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.24k stars 1.01k forks source link

isolated webpart with Graph API fails on classic page #5346

Closed mayurnjoshi closed 2 years ago

mayurnjoshi commented 4 years ago

Category

Describe the bug

Isolated web part that calls the Graph API fails with an error when added to a classic page.

"Error: Error - Type : interaction_required - Description : AADSTS65001: The user or administrator has not consented to use the application with ID 'd1271c0c-8e56-4dec-9af8-13fdcd1ad199' named 'SharePoint Online Client Extensibility Web Application Principal'. Send an interactive authorization request for this user and resource. Trace ID: aa9c4678-31d8-4851-9b9d-0885cc3b4b00 Correlation ID: 30364ebd-2bad-43d5-a6c6-eb534b84ebd0 Timestamp: 2020-02-14 22:03:42Z at Array. (https://spoprod-a.akamaihd.net/files/sp-client/sp-classic-page-assembly_en-us_c2c99f9687f5d0d24a4da9da5b7735cb.js:19:104696) at _callBackMappedToRenewStates.._callBackMappedToRenewStates. (https://spoprod-a.akamaihd.net/files/sp-client/chunk.vendors~sp-http-adal_6b9e7303076d10ea2d2a.js:1:7704) at AuthenticationContext.handleWindowCallback (https://secure.aadcdn.microsoftonline-p.com/lib/1.0.16/js/adal.min.js:2:24607)

Steps to reproduce

  1. Create a SPFx web part that is configured for isolated domain and has graph client.
  2. Add the web part to a classic page.

Expected behavior

The web part should function and the API call should be successful.

Developer environment

msft-github-bot commented 4 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

bcameron1231 commented 4 years ago

The error shows the application hasn't been approved to call that Graph Resource. Did you approve the permissions from API Management in the Admin Center?

andrewconnell commented 4 years ago

Agree with @bcameron1231 ... if your repro steps are complete, you forgot to grant the permission request: https://docs.microsoft.com/sharepoint/dev/spfx/use-aadhttpclient#manage-permission-requests

mayurnjoshi commented 4 years ago

Yes, the permissions are granted, the web part works well when hosted on a modern page but the issue occurs when the same web part is added to a classic page.

mayurnjoshi commented 4 years ago

@andrewconnell - I see you added as the status: by-design label, does that mean isolated webparts aren't supposed to work on classic pages? or was that you anticipated as by-design thinking I didn't approve the permissions?

andrewconnell commented 4 years ago

It wasn't clear you were saying it worked on modern, but not on classic.

patmill commented 2 years ago

Sorry for going dark. One more question - is there any chance that your classic page is hosted in a different domain (like the -my domain)?

ghost commented 2 years ago

This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within the next 7 days of this comment. Please see our wiki for more information: Issue List Labels: Needs Author Feedback & Issue List: No response from the original issue author

ghost commented 2 years ago

Closing issue due to no response from the original author. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: No response from the original issue author