Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
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.
Hello @Anonymous ,
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
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
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
29 | |
19 | |
19 | |
13 | |
12 |