spontoreau / PowerBI.Api.Client

PowerBI REST API Client (no longer maintained)
MIT License
19 stars 14 forks source link

Authentication - client_secret missing? #26

Closed yungmone closed 9 years ago

yungmone commented 9 years ago

Hi Sylvain, Thank you for sharing this package, has really helped me out. I was wondering if you had any experience with the below issue when using the package - I made sure my user/password info is correct in Web.Config, and on Azure Active Directory the app had full access (as you showed in one of the other Issues Threads), but it doesn't seem like that's the issue -- seems the OAuth "client_secret" (i.e. the password?) is missing?

_"{"Message":"An error has occurred.","ExceptionMessage":"AADSTS90014: The request body must contain the following parameter: 'client_secret or clientassertion'.\r\nTrace ID: 17dca2cd-f0d9-4dff-bddc-12513ec9d55a\r\nCorrelation ID: 365cd5d2-bd86-4a0b-b4d1-587fc3c8226e\r\nTimestamp: 2015-04-22 10:24:10Z","ExceptionType":"Microsoft.IdentityModel.Clients.ActiveDirectory.AdalServiceException","StackTrace":" at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext.RunAsyncTask[T](Task1 task)\r\n at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext.AcquireToken(String resource, String clientId, UserCredential userCredential)\r\n at PowerBI.Api.Client.PowerBIClient.Authenticate()\r\n at PowerBI.Api.Client.PowerBIClient.Do[T](Func2 function)

Thank you for your help!!

yungmone commented 9 years ago

Figured it out - for anyone else: Instead of creating a "Web App" in Azure Active Directory, create and use a "Native App" as shown here https://msdn.microsoft.com/en-US/library/dn877542.aspx#client