Forum Discussion
Anonymous
4 years agoNot applicable
AccessUnauthorized on Mashup engine using Gateways - Update Datasource API
Hi, I'm using the Gateways - Update Datasource API to programmatically change the credentials of a dataset that connects to a PBI dataflow. I use the following call: PATCH https://api...
- Anonymous4 years ago
Finally got an answer from the PBI product group.
The correct payload to use (totally undocumented) is:
{ "credentialDetails": { "credentialType": "OAuth2", "encryptedConnection": "Encrypted", "encryptionAlgorithm": "None", "privacyLevel": "Organizational", "useCallerAADIdentity": true } }I call it using a password grant token in the Authorization Bearer.
This undocumented payload does not require a token in the payload thanks to the property:
"useCallerAADIdentity": true
V-lianl-msft
4 years agoCommunity Support
Hi Anonymous ,
You could try OAuth 2.0 resource owner password credentials grant
// Line breaks and spaces are for legibility only. This is a public client, so no secret is required.
POST {tenant}/oauth2/v2.0/token
Host: login.microsoftonline.com
Content-Type: application/x-www-form-urlencoded
client_id=6731de76-14a6-49ae-97bc-6eba6914391e
&scope=user.read%20openid%20profile%20offline_access
&[email protected]
&password=SuperS3cret
&grant_type=password
Make sure your Application's Grant Types include Password.
You can also refer to:
https://stackoverflow.com/questions/63321532/sharepoint-rest-api-how-to-get-access-token
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.