问题
I am trying to send POST request to
https://login.windows.net/common/oauth2/token to get authorization code with parameters inside the body:
{
"grant_type":"password",
"client_id":"xxxxxxxxxxxxxxxxxx",
"resource":"https://analysis.windows.net/powerbi/api",
"username":"xxxxx.onmicrosoft.com",
"password":"xxxxxxx",
"client_secret":"xxxxxxxxxxxxxx"
}
I am getting error:
{ "error": "invalid_request", "error_description": "AADSTS90014: The request body must contain the following parameter: 'grant_type'. Trace ID: 6725893b-5f12-4f6b-9334-ea6c86f10400 Correlation ID: 27f51716-70fb-45f0-85d5-4ccfb32390c2 Timestamp: 2018-10-16 12:21:04Z", "error_codes": [ 90014 ], "timestamp": "2018-10-16 12:21:04Z", "trace_id": "6725893b-5f12-4f6b-9334-ea6c86f10400", "correlation_id": "27f51716-70fb-45f0-85d5-4ccfb32390c2" }
what should be given as resource paramter?
how can i solve this issue?
回答1:
I googled your error code (AADSTS90014) and found a lot of posts on the topic. At a glance, I would try the solution at the bottom of this post:
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/d54c668f-d8e3-4662-b124-d9abc3176c8c/http-post-body-parameters-to-get-oauth2-token?forum=azurelogicapps
I would have left this as a comment but I'm still short of the 50 required reputation points.
Thanks
来源:https://stackoverflow.com/questions/52835441/unable-to-connect-to-power-bi-using-restapi