Forum Discussion

Tekell09's avatar
Tekell09
Frequent Visitor
2 years ago

Service Returned an Invalid Token

I'm simply trying to connect to a Sharepoint Online List. It's worked well until recently. I cannot figure out how to cure the below error message. I have cleared permissions, signed in and out and back in. 

 

How do I properly connect to this data source ? 

 

 

16 Replies

  • I fixed this by performing the following steps

    1 uninstalled Power BI Desktop

    2 Deleted the Power BI Desktop Microsoft Store folder on C drive, uninstalling PBI desktop does not remove most of these folders/files.

    3 Restarted computer

    4 Installed PBI desktop from Microsoft store

  • I was able to fix this in a very simple way, and it seems the issue is related to authentication.

    When you try to edit the permissions, Power BI prompts you to select an account. If you simply click on your listed account, you’ll likely end up seeing the same error again.

     

    Here’s what worked for me:

    1. When prompted to select an account, choose “Sign in with a different account.”

    2. Then, enter the same account and password you were using before.

    3. You might be asked to go through the MFA (Multi-Factor Authentication) process again.

    4. Once completed, the token error disappeared and everything started working properly.

    I hope this helps someone else facing the same issue!

    • Tekell09's avatar
      Tekell09
      Frequent Visitor

      We're a 2-person company right now, we don't have IT. 

  • I'm experiencing this same issue. Trying to connect, in Power BI, to OData Feed using a given URL.

  • I managed to solve this issue by updating Power BI web services. Find your workspace and your data model and click on settings. After that click on Data source credentials, then Edit credentials and select OAuth2. Sign in again using your Credentials and restart your PBI file. Hopefully this will fix your issue!

  • 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.