Skip to main content
Microsoft Idea

Power BI

Declined

oauth

Vote (619) 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 (135)
Bjoern Sjut's profile image Profile Picture

James Feek on 05 Jul 2020 23:49:47

RE: oauth

And how about Power Query / Get & Transform in Excel? Doesn't seem to be much progress on the "upcoming changes" listed on https://github.com/microsoft/DataConnectors

Bjoern Sjut's profile image Profile Picture

Andrew T. on 05 Jul 2020 23:49:44

RE: oauth

vote

Bjoern Sjut's profile image Profile Picture

Sreenivas Amirineni on 05 Jul 2020 23:49:16

RE: oauth

I am suppose to caste my vote for this future but not work well!. This is much indeed future for Power BI.

Bjoern Sjut's profile image Profile Picture

john on 05 Jul 2020 23:49:12

RE: oauth

I want to vote for this but cannot. Please give me permissions.

Bjoern Sjut's profile image Profile Picture

john on 05 Jul 2020 23:49:12

RE: oauth

please add

Bjoern Sjut's profile image Profile Picture

Andrew T. 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

Andreas Bosch 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

Andreas Bosch 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

Power BI Ideas Admin 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

Power BI User on 05 Jul 2020 23:33:56

RE: oauth

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