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.
- Go to the SharePoint site collection where you want to check the permissions.
- Click on the gear icon in the top right corner and select "Site settings".
- Under the "Users and Permissions" section, click on "Site app permissions".
- Check if the app principal for your access token is listed. If it is not listed, you may need to re-register the access token.
- If the app principal is listed, click on it to view the permissions.
- Check that the "Scope" and "Right" parameters in the permission XML match the permissions listed for the app principal.
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.