I am trying to integrate Power BI into angular 1 application. From my research i came to know i have to follow following process
- Authenticate User and get access token
- By using this token get Embed token
But i am struck at first step. How to authenticate?
i have made an API call to https://login.microsoftonline.com/common/oauth2/token
with parameters :
grant_type:'password', client_id: clientId, resource:'https://analysis.windows.net/powerbi/api', scope:'openid', username:username, password:password, client_secret : client_secret
i am getting following response :
"error": "invalid_client",
"error_description": "AADSTS70002: Error validating credentials. AADSTS50012: Invalid client secret is provided.\r\nTrace ID: 51694a76-ebf8-4923-9a8c-2a1ad2e35600\r\nCorrelation ID: f25bedeb-7aa9-45db-a93f-d8dfd85d0f19\r\nTimestamp: 2017-11-27 06:02:56Z",
"error_codes": [
70002,
50012
],
"timestamp": "2017-11-27 06:02:56Z",
"trace_id": "51694a76-ebf8-4923-9a8c-2a1ad2e35600",
"correlation_id": "f25bedeb-7aa9-45db-a93f-d8dfd85d0f19"
i don't know i am calling right API or not. whats the use of resource in parameter?
can anyone please help! thanks
