SharePoint / SharePoint/sp-dev-docs

Unable to approve SharePoint API Permissions: "Access can't be approved because you didn't accept the requested permissions"

Open
#10,143 33 comments 1 reaction 1 assignee View on GitHub

Nobody has claimed this yet.

sharepoint-developer-support type:bug-confirmed type:bug-suspected
Dominant language
PowerShell
Stars
1.4k
Forks
1.1k
Avg merge
4d 12h
Merged PRs (30d)
12

Description

Target SharePoint environment

SharePoint Online

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

💥 SharePoint Framework

Developer environment

Windows

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
  • All tested browsers (latest versions)
  • SPFx version: 1.17.1
  • Node.js version: 16.20.0
Describe the bug / error

In the past week or so (not sure exactly when) an App package which has previously installed without issues has stopped working. After adding the App to the App Catalog, we are unable to approve any API permissions. After clicking 'Approve' the following error is displayed as opposed to the pop-up to consent to the requested permissions:

Image

We have tested this in multiple M365 tenants... so something must have changed in M365?

Steps to reproduce

NOTE: The app package has been installed into 100's of tenants since May 24. The app package has not changed since this date.

App Permissions are set in the "webApiPermissionRequests" array within the pakage-solution.json, example:

Image

The following permissions are contained:

  • "resource": "Windows Azure Active Directory" - "scope": "User.Read"
  • "resource": "" - "scope": "user_impersonation",
  • "resource": "Microsoft Graph" - "scope": "Sites.FullControl.All"
  • "resource": "Microsoft Graph" - TermStore.Read.All
  • "resource": "Microsoft Graph" - User.Read

The reply URL is formed as follows:

https://login.microsoftonline.com/common/adminconsent?client_id=[clientId]&redirect_uri=[staticHtmlPage]

The reply URl's are all present within web section of the app registration within Entra

Expected behavior

On clicking 'Approve' on a pending 'API Access' request, we should be able to consent to requested permissions

Any ideas what has changed which means we not receive the reported error?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.