Forum Discussion
DMG Web data source - how to pass through end-user's credential ?
- 7 years ago
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" ])),
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.
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"
])),