Skip to main content

Power BI

Declined

oauth

Vote (575) Share
Bjoern Sjut's profile image

Bjoern Sjut on 29 Mar 2016 19:24:59

Add oauth(2) as an option to authenticate for e.g. web.contents.

Administrator on 30 Oct 2018 01:34:04

This is enabled via Custom Connectors: https://docs.microsoft.com/en-us/power-query/startingtodevelopcustomconnectors

Comments (130)
Bjoern Sjut's profile image Profile Picture

fbfd007f f68d-4731-ac7c-4b5a8f9f4922 on 05 Jul 2020 23:47:36

RE: oauth

What a garbage response. Oath is the standard for API authentication. By not enabling it Microsoft is preventing Power BI from being able to access a ton of data. Choosing to not implement this is a terrible decision. The workaround (Custom Connectors) doesn't work in the cloud.

Bjoern Sjut's profile image Profile Picture

b9065961 f685-4c3a-95ad-9645aec04ed1 on 05 Jul 2020 23:35:57

RE: oauth

The code was copied from: https :// docs.leanix.net/ docs/custom-integrations

Bjoern Sjut's profile image Profile Picture

b9065961 f685-4c3a-95ad-9645aec04ed1 on 05 Jul 2020 23:35:56

RE: oauth

So sad Microsoft is not willing to help us here.

Maybe this code helps some of you to get it done...

Copied from

let
BaseURL = "https://.leanix.net", // This is evaluated by Power BI Online to check if auto-refresh is possible without authentication

AuthKey = "APITOKEN_ENCODED", // Base64 Encoded "apitoken:API Token" string
AuthHeader = "Basic " & AuthKey, // Concatenate two strings for "Authorization:" Header in POST Request to get OAuth access token
AuthRelativePath = "services/mtm/v1/oauth2/token", // Here we get our access token from with our AuthKey
grant_type = "grant_type=client_credentials", // Indicates the type of grant presented in exchange for an authentication token

Endpoint = "graphql", // The endpoint we are interested in
EndpointRelativePath = "services/pathfinder/v1/" & Endpoint, // We can call this HTTP REST Endpoint via GET to get all applications as JSON once we have the OAuth acccess Token

gqlQuery = "{ ""query"": ""{allFactSheets(factSheetType:Application){edges{node{id name description ... on Application{lifecycle{asString} technicalSuitability technicalSuitabilityDescription businessCriticality businessCriticalityDescription functionalSuitability functionalSuitabilityDescription }}}}}}}}""}",

// We do a HTTP POST Request to BaseURL + AuthRelativePath with our AuthenticationKey in the Header and some extra data to get the access token in JWT format
JWT = Json.Document(Web.Contents(BaseURL, [RelativePath=AuthRelativePath, Headers=[#"Authorization"=AuthHeader, #"Content-Type"="application/x-www-form-urlencoded"], Content=Text.ToBinary(grant_type)])),

// OAuth 2.0 authentication is done and we use the access token to construct the Authorization Header fo

Bjoern Sjut's profile image Profile Picture

a3309361 99be-ea11-a812-000d3a8ddfb2 on 05 Jul 2020 23:33:59

RE: oauth

Looks like we still can't do anything for the cloud...

Bjoern Sjut's profile image Profile Picture

5babedcc 7581-4ba2-896b-0fa4de0a4a25 on 05 Jul 2020 23:33:56

RE: oauth

This "solution" also doesn't address use outside of PowerBI Desktop.

Bjoern Sjut's profile image Profile Picture

182ea6eb 4bfa-41c4-9020-46e5c1324e1e on 05 Jul 2020 23:33:43

RE: oauth

Ha ha ha, This is a laughable response. So now I am to either carry on using Basic Auth on my APIs or start telling my customers: "Here download and follow these installation instructions to install this weird file before you can use Power BI for what it was intended to do". That's even worse than asking a client to follow instructions on how to generate an API key and I've never seen that work out well.

We considered Custom Connectors but didn't want to wear the cost of providing application support to 5000 customers.

I mean, I had to roll my own Basic Auth provider when we started working onto dotNET Core just to support Power BI and Excel. Did you hear me?! I rolled my own Auth provider to a data API to support your product; that's insane!

Please reopen this idea, please implement OAuth as a connector. I fail to understand how this can be hard for you to do or what Microsoft's strategic value is in not providing it.

Bjoern Sjut's profile image Profile Picture

3eaceb84 7337-e811-a955-000d3a1bef07 on 05 Jul 2020 23:33:37

RE: oauth

Daniel there is a link posted in their response on how create custom connections.

Bjoern Sjut's profile image Profile Picture

f2f782bd d0e7-42f8-b44e-68828bb89f53 on 05 Jul 2020 23:33:36

RE: oauth

Hi Miguel. I can understand you saying 'not planned', but you have not given us any alternative to connect to API's? Please provide a solution.

Bjoern Sjut's profile image Profile Picture

46bdc61c d14b-436b-8f9c-223208f88a15 on 05 Jul 2020 23:33:27

RE: oauth

Disappointed. Not a relevant solution.

Bjoern Sjut's profile image Profile Picture

31c2ca7e 5cd3-4f45-80f3-96538e823138 on 05 Jul 2020 23:33:25

RE: oauth

An unexpected short answer after all that time. How about Power BI Online? What is the story around that ?