<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Cant authenticate as a user with Postman (400 error) in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Cant-authenticate-as-a-user-with-Postman-400-error/m-p/547084#M17010</link>
    <description>&lt;P&gt;I posted this as a reply in another thred while it should have been a new post, sorry!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I am trying to&amp;nbsp;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, when I try to authenticate using Postman, I am getting this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{
    "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"
}&lt;/PRE&gt;&lt;P&gt;My request:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;POST https://login.microsoftonline.com/common/oauth2/token&lt;/PRE&gt;&lt;P&gt;and the payload:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;grant_type: password
client_id: {{client_id}}
resource: https://analysis.windows.net/powerbi/api
scope: openid
username: {{username}}
password: {{password}}&lt;/PRE&gt;&lt;P&gt;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?&lt;/P&gt;</description>
    <pubDate>Fri, 19 Oct 2018 12:37:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-10-19T12:37:02Z</dc:date>
    <item>
      <title>Cant authenticate as a user with Postman (400 error)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Cant-authenticate-as-a-user-with-Postman-400-error/m-p/547084#M17010</link>
      <description>&lt;P&gt;I posted this as a reply in another thred while it should have been a new post, sorry!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I am trying to&amp;nbsp;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, when I try to authenticate using Postman, I am getting this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{
    "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"
}&lt;/PRE&gt;&lt;P&gt;My request:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;POST https://login.microsoftonline.com/common/oauth2/token&lt;/PRE&gt;&lt;P&gt;and the payload:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;grant_type: password
client_id: {{client_id}}
resource: https://analysis.windows.net/powerbi/api
scope: openid
username: {{username}}
password: {{password}}&lt;/PRE&gt;&lt;P&gt;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?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 12:37:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Cant-authenticate-as-a-user-with-Postman-400-error/m-p/547084#M17010</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-19T12:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Cant authenticate as a user with Postman (400 error)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Cant-authenticate-as-a-user-with-Postman-400-error/m-p/568360#M17627</link>
      <description>&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 08:34:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Cant-authenticate-as-a-user-with-Postman-400-error/m-p/568360#M17627</guid>
      <dc:creator>NEbdf</dc:creator>
      <dc:date>2018-11-19T08:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: Cant authenticate as a user with Postman (400 error)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Cant-authenticate-as-a-user-with-Postman-400-error/m-p/568594#M17632</link>
      <description>&lt;P&gt;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...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 13:10:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Cant-authenticate-as-a-user-with-Postman-400-error/m-p/568594#M17632</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-19T13:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Cant authenticate as a user with Postman (400 error)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Cant-authenticate-as-a-user-with-Postman-400-error/m-p/568597#M17633</link>
      <description>&lt;P&gt;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!&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 13:18:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Cant-authenticate-as-a-user-with-Postman-400-error/m-p/568597#M17633</guid>
      <dc:creator>NEbdf</dc:creator>
      <dc:date>2018-11-19T13:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Cant authenticate as a user with Postman (400 error)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Cant-authenticate-as-a-user-with-Postman-400-error/m-p/568599#M17634</link>
      <description>&lt;P&gt;AFAIK, the sysadmin registered the powerbi app,&amp;nbsp; 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).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 13:25:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Cant-authenticate-as-a-user-with-Postman-400-error/m-p/568599#M17634</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-19T13:25:17Z</dc:date>
    </item>
  </channel>
</rss>

