We implemented OData Api with Asp.Net Core App (.Net 6). We want to authorize the access with AAD and the OData Connector. Inbetween the Api we used AddJwtBearer Middleware with tenant clientid , clientsecret etc. per documentation. We tried a customer connector like this:
section PQExtension1;
[DataSource.Kind="PQExtension1", Publish="PQExtension1.Publish"] shared OpenPlatform.Feed = Value.ReplaceType(PQExtension1Impl, type function (url as Uri.Type) as any);
PQExtension1Impl = (url as text) => let source = OData.Feed(url)
in source;
PQExtension1 = [ Authentication = [ Aad = [ AuthorizationUri = "https://login.microsoftonline.com/common/oauth2/authorize", Resource = ... ] ], Label = Extension.LoadString("DataSourceLabel") ];
...
This works in PowerBI Desktop. As uncertified Custom Connectors are not supported in PowerBI portal we cannot use it. In PowerBI Portal using Organizational Account with standard OData Connector we get the error: This credential type is not supported.
Is there a way to authorize access to our API with AAD at app.powerbi.com? We tried OAuth but didn't get it running. Could you provide an example what we have to code in our API to get it working?