- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Cant authenticate as a user with Postman (400 error)
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-19-2018 05:36 AM - edited 10-19-2018 05:37 AM
I posted this as a reply in another thred while it should have been a new post, sorry!
So I am trying to use the PBI API via REST requests done by Postman. All of these requests will be done by a service account with a PowerBI Pro license (currently my account for testing purposes) which will copy/modify workspaces so that we can automate the workspace creation process.
I know the credentials are working because I can log with them on the PowerBI website and I can make API calls using a Python API library (which unfortunately does not have all the required end points, hence me using Postman).
So, when I try to authenticate using Postman, I am getting this:
{ "error": "invalid_grant", "error_description": "AADSTS70002: Error validating credentials. AADSTS50126: Invalid username or password\r\nTrace ID: 3094c744-940a-42ff-ad1f-acb1ad2c3b00\r\nCorrelation ID: 3300c98a-f742-4664-850a-ef04b6032244\r\nTimestamp: 2018-10-19 12:22:37Z", "error_codes": [ 70002, 50126 ], "timestamp": "2018-10-19 12:22:37Z", "trace_id": "3094c744-940a-42ff-ad1f-acb1ad2c3b00", "correlation_id": "3300c98a-f742-4664-850a-ef04b6032244" }
My request:
POST https://login.microsoftonline.com/common/oauth2/token
and the payload:
grant_type: password client_id: {{client_id}} resource: https://analysis.windows.net/powerbi/api scope: openid username: {{username}} password: {{password}}
From what I have seen in the forum, this _should_ work. Has something changed recently that breaks this way of authentication? If there something wrong with my account?
Re: Cant authenticate as a user with Postman (400 error)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-19-2018 12:34 AM
Sorry, no solution here. But I am having the same issue since over half a year. Only the C# demo of MS seemed to work, nothing else. Would love to hear of someone getting the Token API working in Postman.
Re: Cant authenticate as a user with Postman (400 error)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-19-2018 05:10 AM
I managed to make it work by asking my azure sysadmin to create a service account and making this account the owner of the app. I dont understand why it would make it different than using my own credentials (with me as owner) but apparently, it does because now I can log via password...
Re: Cant authenticate as a user with Postman (400 error)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-19-2018 05:18 AM
Do you maybe have some more detailed informations regarding that service account and how it is created? I would like to ask my Azure Admin too for that, but might have to point in the right direction. Thanks!
Re: Cant authenticate as a user with Postman (400 error)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-19-2018 05:25 AM
AFAIK, the sysadmin registered the powerbi app, then created a normal user and assigning the user as the owner of the registered PowerBI app, and also granting the permission to the app (something I was not able to do when I was the one registering the app).
Hope it helps