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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Digger
Post Patron
Post Patron

OAUTH API anonymous domain return 301

I have a power query with a REST api call:

 

 authKey = "Bearer blablablaKey",
 url = "https://app.fleethand.com/oauth/token",

 GetJsonQuery = Web.Contents(url,
     [
         Headers = [#"Authorization"=authKey, #"Content-Type"="application/json"]
     ]
 ),
FormatAsJsonQuery = Json.Document(GetJsonQuery),

So, this power query use "Anonymous" authentication. When i refresh this query in Power BI Desktop appears credentials error, but if you accept the power query is executed and everything is ok.

 

PBI check if any of domain path return 200 response code, but how to bypass this checking? As my domain return redirect 301 or 401

so PBI cant proof domain page

1 ACCEPTED SOLUTION
v-rongtiep-msft
Community Support
Community Support

Hi @Digger ,

This is not possible due to constraints with the way Web.Contents stores credentials. They are stored based upon the URL value passed, and there can only be one URL per Dataset. In this case, you're trying to short-circuit a typical oAuth2 flow (one URL) and call the API (another URL). When we made an attempt at using RelativePath to 'trick' the service, but stills require that the root of those two endpoints returned a valid HTTP 200 response to indicate connection success. In this case, https://www.googleapis.com returns a 404.

 

The only workaround for us so far, is to execute the query elsewhere and connect PBI to that as a data source.

 

I have also found a similar post, please refer to you to see if it helps you.

Attempt to get list of Workspaces via REST API results in 401 Unauthorized. 

  • By going to your App Registration and clicking on API Permissions and then clicking on any of the API permissions you've added. This will bring up a window which shows the URL for that API Permission.

 

If it does not help, please provide more details. 

Will this error be reported when you log in with a different authentication? Can you refresh it in the Power

Query?  What are the specific errors? Could you please provide a screenshot with the error.

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

View solution in original post

1 REPLY 1
v-rongtiep-msft
Community Support
Community Support

Hi @Digger ,

This is not possible due to constraints with the way Web.Contents stores credentials. They are stored based upon the URL value passed, and there can only be one URL per Dataset. In this case, you're trying to short-circuit a typical oAuth2 flow (one URL) and call the API (another URL). When we made an attempt at using RelativePath to 'trick' the service, but stills require that the root of those two endpoints returned a valid HTTP 200 response to indicate connection success. In this case, https://www.googleapis.com returns a 404.

 

The only workaround for us so far, is to execute the query elsewhere and connect PBI to that as a data source.

 

I have also found a similar post, please refer to you to see if it helps you.

Attempt to get list of Workspaces via REST API results in 401 Unauthorized. 

  • By going to your App Registration and clicking on API Permissions and then clicking on any of the API permissions you've added. This will bring up a window which shows the URL for that API Permission.

 

If it does not help, please provide more details. 

Will this error be reported when you log in with a different authentication? Can you refresh it in the Power

Query?  What are the specific errors? Could you please provide a screenshot with the error.

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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