Forum Discussion

Number_Five's avatar
Number_Five
Copper Contributor
Apr 01, 2023
Solved

Unable to retrieve list items with app-only access token via PnP PowerShell

I created an access token and registered it granting fullcontrol to a site collection. In powershell, I connect via the connect-pnponline cmdlet and everything is fine. I can list items in the site c...
  • Number_Five's avatar
    Number_Five
    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.

Resources