cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MisterFry
Resolver III
Resolver III

Unable to create connections to Sharepoint: Microsoft.IdentityModel.Tokens.AudienceUriValidationFail

When I try to connect in the web service to pull the files into a datamart, I get an error:
Exception of type 'Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException' was thrown.
this SUGGESTS that I'm missing some kind of permissions to create the connection to sharepoint.
 
In this case, I am the owner of the Sharepoint folder.
 
My user is able to access the Sharepoint folder.
 
I am also experiencing issues in the desktop version that might be similar. (Desktop Version: 2.107.841.0 64-bit (July 2022)) I used to be able to create connections to sharepoint via the sharepoint folders connection type. I am no longer able to do this. I get an error that I can't be authenticated with the provided credentials. 
 
Further weirdness is that EXISTING connections to sharepoint folders that I've created in the past continue to work. 
I can also copy the connection information out of an existing sharepoint connection, and repurpose the query, and it works. This is an interesting workaround, but doesn't solve my issue as I need to read this data into a dataflow, or a datamart on the server. 
 
Possibly related, I CAN access it via the office365.runtime.auth.authenticationContext in Python.

 

from office365.runtime.auth.authentication_context import AuthenticationContext
from office365.sharepoint.client_context import ClientContext
from office365.sharepoint.files.file import File
from openpyxl import load_workbook

url = "https://<org>.sharepoint.com/sites/<site>/"
ctx_auth = AuthenticationContext(url)
ctx_auth.acquire_token_for_user(<secret>, <secret>)
ctx = ClientContext(url, ctx_auth)
response = File.open_binary(ctx, "/sites/<site>/<file>")​

 

1 ACCEPTED SOLUTION
MisterFry
Resolver III
Resolver III

The issue is that the Sharepoint site requires the https:// at the beginning of the hostname. 

View solution in original post

2 REPLIES 2
MisterFry
Resolver III
Resolver III

The issue is that the Sharepoint site requires the https:// at the beginning of the hostname. 

lbendlin
Super User
Super User

I used to be able to create connections to sharepoint via the sharepoint folders connection type. I am no longer able to do this. I get an error that I can't be authenticated with the provided credentials. 

Go to Global Data Source Settings and remove all Sharepoint entries.  Then re-authenticate in your query.

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.

Top Solution Authors
Top Kudoed Authors