Forum Discussion
Unable to retrieve list items with app-only access token via PnP PowerShell
- Apr 02, 2023
The step I was missing appears to have been the following:
https://docs.informatica.com/integration-cloud/data-integration-connectors/current-version/microsoft-sharepoint-online-connector/introduction-to-microsoft-sharepoint-online-connector/administration-of-microsoft-sharepoint-online-connector/generate-the-authorization-code.html
I did not need the authorization code (for the token refresh) but merely triggering that oauthorize.aspx did the trick. I did this twice, with two different app-only access tokens and I could finally use both to access data within the site collections via PS.
Make sure that DisableCustomAppAuthentication is set to False. By default in new tenant this setting is set to True,
You can change this setting via SharePoint Online Management Shell
Make sure that once you change this setting at tenant level, it can take up to 24 hours to apply this settings.
Hope it will helpful to you and if so then Please mark my response as Best Response & Like to help others in this community