cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ubt_luke
Regular Visitor

Custom Connector OAuth | 404 when using gateway and app.powerbi.com

I have setup a custom connector that using OAuth2 authentication however I'm having issues trying to get this to authenticate on app.powerbi.com via a personal or enterprise gateway.

The connector successfully authenticates when using it with Power Bi desktop however as soon as I publish the report and try to setup authentication for the dataset, I get a 404 not found error returned as below.

 

ubt_luke_2-1653593160443.png

 

The code returned by the OAuth2 service is quite long, between 4000-5000 characters. Is there a query or URL length limit for the redirect_uri https://oauth.powerbi.com/views/oauthredirect.html?

I did some testing with my own OAuth2 server and as soon as the authorization code exceeded about 4200 characters, I started getting the same issue.

2 REPLIES 2
ubt_luke
Regular Visitor

Hello @v-jayw-msft ,

 

I have implemented the test connection.

I built two identical custom connectors with the only difference being the OAuth2 server used to authenticate and as soon as the authorization code returned by the OAuth2 server exceeded around 4200 characters, I get the 404 error otherwise I can use them perfectly fine with the on-premises data gateway.

 

It appears there is some limit to the length of the code that the Power Bi redirect uri can handle.

 

The issue here is that the service provider is unable to change the length of the code returned and from what I can work out, the OAuth2 specification doesn't specify a limit to code therefore this is within specification.

 

After raising an issue with Microsoft Power Support, this is the place they told me to come as apparently they don't handle these issues.

 

Are you able to point me in the right direction to get this issue sorted?

 

Luke

v-jayw-msft
Community Support
Community Support

Hi @ubt_luke ,

 

OAuth for custom connectors via gateways is currently supported only for gateway admins but not other data source users.

The method for implementing TestConnection functionality is likely to change while the Power BI Custom Data Connector functionality is in preview.

To support scheduled refresh through the on-premises data gateway, your connector must implement a TestConnection handler.

For more details, please check this document.

https://docs.microsoft.com/en-us/power-query/handlinggatewaysupport 

 

Best Regards,

Jay

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

Helpful resources

Announcements
September Update

Check it Out!

Click here to learn more about the September 2022 updates!

Power BI Dev Camp Session 26

Check it Out!

Mark your calendars and join us on Thursday, September 29 at 11a PDT for a great session with Ted Pattison!

Top Solution Authors
Top Kudoed Authors