Skip to content

How to consume sharepoint data from other site collection where ussrs dont have access in spfx #9872

@SAgnihotri200895

Description

@SAgnihotri200895

What type of issue is this?

Question

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Target SharePoint environment

SharePoint Online

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • browser version
  • SPFx version
  • Node.js version
  • etc

Issue description

I'm developing a SPFx web part that will be deployed on one site collection. This web part needs to retrieve data from another site collection that resides in a different geolocation.

The challenge is that not all users will have read access to this other site collection.Our client prefers not to introduce additional interfaces in SPFx for support reasons, so we're trying to avoid using a middle-layer API as much as possible.

Instead, we're looking for a solution to access the data directly within the SPFx web part itself.Initially, we considered using the SharePoint App Only model, but since it's being deprecated, we're exploring other options.

I've read that AADHttpClient could be a solution, and that by adding the necessary API permissions in SPFx, it should work.

However, when I try to deploy it, the API access in the admin center throws an error saying the scope sites.read.all is not valid.

I'm using the resource SharePoint Online Extensibility Web Application Principal, but it's failing.Is this the correct approach?

I haven't found much documentation on this.In summary, I need to know if it's still possible with SPFx 1.19 to use AADHttpClient for accessing SharePoint data via REST calls. What API permission requests should I be making for this?⁶

Metadata

Metadata

Assignees

Labels

Needs: Author FeedbackAwaiting response from the original poster of the issue. Marked as stale if no activity for 7 days.Needs: Triage 🔍Awaiting categorization and initial review.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions