Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors