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
timowille
New Member

Web Content - Access Method - WWW-Authenticate header doesn't contain a valid authorization URI

Hi,

 

i'm trying to connect to a custom REST service hosted on an azure app service that is configured to authenticate against Azure Active Directory. The authentication is working fine, when i open the apis url from a browser.

When trying to connect via Power BI :

1.PNG

 

I get the following message when i try to authenticate using an organizational account: The WWW-Authenticate header doesn't contain a valid authorization URI. Header value: 'Bearer realm="XYZ.azurewebsites.net"'.

2.PNG

 

 

 

Has anyone managed to authenticate against Azure AD using Power BI for querying data from a Web Api?

Any idea what i'm doing wrong?

 

Cheers!

 

Timo

23 REPLIES 23
Pranay_Sharma
Frequent Visitor

There is something changed since 5th April, the API data sources are complaining with same error message-WWW-Authenticate header doesn't contain a valid authorization URI.
Is there a solution to fix this error. It shows up when you go for Organizational Authentication.

We are facing the same issue , unable to authenticate while connecting ,getting below error 

Something went wrong

It looks like the refresh token expired. Please go to this dataset's settings page, and reenter the OAuth2 credentials for the Web data source.

Please try again later or contact support. If you contact support, please provide these details.Hide details
  • Underlying error messageThe WWW-Authenticate header doesn't contain a valid authorization URI. Header value: 'Bearer'

Found a work around for this, which would be hepful and would transition from APIs to Sharepoint-

 

1. Add the Microsoft form to the "Form Group Name" Forms Group.
This can be done by opening the forms home page, scroll to bottom and click on "All My Forms". On the next page, click on ellipses and choose "Move".( We'll first try to copy the form and responses, and will then see how it goes.)

2. After the form is moved, Open the form again from "All My Forms" Page, and then Open responses in excel, Go to File Menu -> Info-> Copy Path.

3. Change the source in the pbix to the new SharePoint web link.

Many thanks Pranay, that worked for me.

For others, I've created a  more detailed Step-bystep guide. Note this is for connecting to Forms and assumes you have SharePoint online:

  1. Go to SharePoint and create a site, I called mine My Forms
  2. Go back to Forms scroll to the bottom of the page, click on All My Forms on right hand side
  3. On the form you need you notice an ellipsis (…) at bottom right, click on move to Group
  4. You should see your recently created site, select it and the form will move to that area
  5. Go back to your Forms landing page and you'll see your form, now when you click on it & go to responses choose Open in Excel
  6. From Excel online, go to File | Info | Open in Desktop App - this will download a copy.
  7. From the copy go to File | Info | Copy Path E.g., https://mysharepoint.sharepoint.com/sites/MyForms/Shared%20Documents/NameOfForm.xlsx?web=1
  8. Now in Power BI create a new query, this time from Web and paste in the content from your clipboard | IMPORTANT Remove the ?web=1 part
  9. You may need to sign in again, but this time you should see the content of your form, which will go on to include any new responses.

Hello MaryF,

 

Thank you for this super clear guide. I tried it out and do not receive the same connection error but I dont see the values in the table anymore. Did I miss something in the URL content that would allow me to get the content of the forms?

 

Thanks for your help 🙂

 

Hi there LPE

When you download the workbook (as per step 6) was there data in that file? Also did you remove the ?web=1 from the end of the URL? If yes to both, then I can't see why you don't see it via Power BI. Sorry I can't be of more help.
Mary

Hello Mary,

 

Thank you for your answer! I missed a step, but now it works perfectly!

Thanks for your precious input!

 

Ludmilla

I found another work around.

 

- Open the Form data in excel desktop

- Then click on Info and copy URL

- To test copy the link and Power query (excel or Power BI) , then connect data to web and log in. 

- To refresh your existing report, copy the link open Power BI - Power query , navigate to the source and update the source link eg 

 

Excel.Workbook(Web.Contents("insert link"), null, true) 

and then you can log in again and your report should be back to normal

Good day. 

 

I tried the above steps and I still run into the same issue. 

We tried this with a test form but we're still running into the same authentication issues.  

Update - so I got this this method to work via the sharepoint folder connection (I missunderstood the instructions) but it changed the link to the original form which stinks and I haven't tried this yet with the actual survey responses so there may be other challenges to consider. I'm just frustrated by the abrupt nature of the change, lack of acknowledgement by MSFT, and general lack of a BI data connector for Forms, necessistating all these work arounds.

 

Second update: So @Pranay_Sharma's solution of moving the form to a group works great (the old forms link automatically redirects so no need to deploy a new URL). you'll have to modify your power query to shift the source from a Web Connect to a SharePoint folder. We had to rebuild our transformation steps but that was pretty straight forward and we didn't run in to any other issues. 

Have you found the answer to this issue? My team and I are struggling with the same issue.

I am having the same issue. The connection was working perfectly on the 5th and now I am getting an error. 

RichieRich
Advocate III
Advocate III

I was experiencing this problem when I had a mix of SharePoint on premises and SharePoint Online. This error came up for the SharePoint on-Prem and I just used "Windows" Authentication instead of the "Microsoft Account". I had ass-u-me-d that they would both use the same authentication method, when they do not.

v-qiuyu-msft
Community Support
Community Support

Hi @timowille,

 

I found the same issue reported before, and the PG said:

 

"The Azure App part is currently unsupported due to a limitation with Azure Active Directory."

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Qiuyun Yu,

 

is there any information on when this will work or is there a workaround? We would like to offer a REST API to make on-prem data available to Organizational Accounts in Power BI. Data Gateway is no option.

 

Thanks for your support!

 

Timo

Hi @timowille,

 

The workaround provided by the PG is:

 

To make this work with Power BI, the endpoint needs to return an URL which looks like

 

WWW-Authenticate: Bearer authorization_uri="https://login.windows.net/a1a2578a-8fd3-4595-bb18-7d17df8944b0/oauth2/authorize"

 

Where the GUID is the AAD tenant ID. This cannot be done entirely via configuration, it involves writing code on the service side.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I'm a bit confused. My ASP.NET Core 2.0 app uses OpenIdConnect to authenticate against AzureAD. Specifically what changes do I need to make so that Power BI can correctly authenticate with my app and consume my JSON API?

Anonymous
Not applicable

@tonjohn @timowille @o365spo @wolfchan @v-qiuyu-msft 

I am getting same error when trying to access Azure analytics view from Power BI desktop using ODataFeeds URL.

 

I posted my question on this link, please help if you can help anything. I am kinda stuck right now.

https://community.powerbi.com/t5/Desktop/Using-OData-Feed-Azure-DevOps-Analytics-URL-working-in-brow...

It's been awhile since I worked in this space... If I recall correctly, I got around this issue by using an API Key instead of Oauth/OpenID.

Anonymous
Not applicable

I actually found a problem.

Active Directory was not setup for the Project I was trying to access using Organizational Credentials from PowerBI.I have used Personal Access Token to access the account from PowerBI while connecting through ODataFeed Data source URL, and it worked fine.

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.