Forum Discussion
Service Returned an Invalid Token
I tried all of the below - none worked. Fortunately my last permutation was successful and involved doing the following, I first went to File -> Options and settings -> Data Source settings. Selected each site which was having the connectivity issue and clicked Clear Permissions (Delete) so they vanished from the list. I then went through the motions of creating a new report:
1. Create Blank Report
2. Table -> Get Data -> More -> Sharepoint Online List -> Connect
3. Sharepoint Online Lists dialogue: Enter site url, select v2.0 implementation radio button -> Click OK
4. In the Navigator dialogue, from my Sharepoint online site i selected the list using the tick box and clicked Load.
5. By virtue of doing this (i.e. successfully logging in with my credentials to the original sharepoint online list), I tried opening the orginal pbix file which would always show "Service Returned an invalid token" or "The credentials provided for the SharePoint source are invalid. Please update the credentials through a refresh or in he Data Source Settings dialog to continue (Source at sharepoint.com/sites/SiteName)" and clicked the Refresh button. And as if by magic my report began to sync up the latest data from the list - the connection worked!
6. I found out that you don't actually need to save the blank report that I just created - I simply discard it.
The usefulness of this process is simply to re-initialise the Data Sources settings for the sharepoint site where the list(s) are located. This ensures the Global Permissions section of the Power BI desktop application is up to date and valid.
Hope this helps others. Chris.