I've went through the following steps:
- Created an Azure AD application + client secret
- Granted SharePoint Sites.Selected permissions at Appplication level
- Given admin consent
- Granted FullControl to the app by using Grant-PnPAzureADAppSitePermission and Set-PnPAzureADAppSitePermission
- Generated the access token on endpoint https://accounts.accesscontrol.windows.net/{tenantId}/tokens/OAuth/2
- Used the token to access the site's REST API (e.g. _api/web)
I get 403 Forbidden. The response header x-ms-diagnostics has the value 3002002; reason=App principal does not exist.
What's going on here? Is Sites.Selected really supported for the SharePoint REST API or am I missing something else?