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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors