If you are using OAuth method for connecting NavSherpa to SharePoint Online, the app permissions granted on SharePoint via Setup Access Token Wizard may expire after some time (by default this is one year for security reasons). Unfortunately, SharePoint does not give you a warning in advance, you will just see following error:
The solution is to clean old app registration in Business Central and create a new one. Optionally, you can delete the expired app registration on SharePoint.
(Optional) Delete expired app registration on SharePoint
Go to the home page of your SharePoint site collection and select Settings and Site Information.
Now click on View all site settings.
In the site settings you are looking for Site collection app permissions. If you can't see the menu item, you are either on a subsite, or you do not have site collection administrator permissions.
Here you can see the list of all application permissions for this SharePoint site collection, and you can delete the expired ones.
Renew the access token in Business Central
Now go to Business Central, open SharePoint Site Setup List and select your root site setup.
On the setup card open the list of access tokens with menu action Access / Access Tokens. Here you can delete the old access token, that is no longer valid. Note: if you are using C/AL version of NavSherpa, this page is not available. You will need to run table 4065020 SharePoint Access Token from the Dev Environment and delete the record here.
After that just use the Access / Setup Access Token menu action on the site setup card to run and finish Setup Access Token Wizard, that will help you create a new valid access token.
From a recent SharePoint update (09/2023) you may encounter following error during access token setup:
New app registration can be created by tenant administrator only.
Or you need to run PowerShell command Set-SPOTenant -SiteOwnerManageLegacyServicePrincipalEnabled $true in your tenant to allow the former behaviour, when the app registrations an be created by site collection administrators.