Forum Discussion
DMG Web data source - how to pass through end-user's credential ?
We are using a Web connection on an Enterprise DMG with basic authentication to retrieve data from an on-prem JIRA instance over a REST API. This datasource is made available to many different self-service users.
We would like each user of the data source to provide their own credentials when they schedule a refresh.
If we select 'basic authentication' for the datasource authentication mode, then access to the datasource is alwas made with the same credentials, regardless of the user requesting the refresh, which is not what we need.
How can the credentials of each user be passed through the DMG to the data source ?
For those intersted in this topic, the workaround consists in creating the data source with anonymous authentication. Then each user can provide the credentials for basic authentication in the PowerQuery code, as in the snippet below. The drawback is that the credentials are exposed in the code = bad !
AuthStr = Binary.ToText(Text.ToBinary("mylogin:mypassword"), BinaryEncoding.Base64), Source = Json.Document(Web.Contents(#"base URL", // basic authentication is passed in code so that the query can refresh through the Data Management Gateway // without the data source admin providing on-behalf-of credentials. [ Headers = [#"Authorization"="Basic " & AuthStr], RelativePath="rest/api/2/filter/" & Text.From(#"Filter ID") &"/columns" ])),
2 Replies
- v-frfei-msft
Community Support
Hi bdarbonneau ,
Based on my test, it is not supported yet currently.
You can come up a new idea about that and add your comments there to improve Power BI and make this feature coming sooner.- bdarbonneauFrequent Visitor
For those intersted in this topic, the workaround consists in creating the data source with anonymous authentication. Then each user can provide the credentials for basic authentication in the PowerQuery code, as in the snippet below. The drawback is that the credentials are exposed in the code = bad !
AuthStr = Binary.ToText(Text.ToBinary("mylogin:mypassword"), BinaryEncoding.Base64), Source = Json.Document(Web.Contents(#"base URL", // basic authentication is passed in code so that the query can refresh through the Data Management Gateway // without the data source admin providing on-behalf-of credentials. [ Headers = [#"Authorization"="Basic " & AuthStr], RelativePath="rest/api/2/filter/" & Text.From(#"Filter ID") &"/columns" ])),