<?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 Re: Issue while generating Embed token with ClientID and login credentials using EmbedApiSample in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Issue-while-generating-Embed-token-with-ClientID-and-login/m-p/404327#M12062</link>
    <description>&lt;P&gt;Thanks for your reply. I tried following both the approaches specified by you, but both doesn't seem to work for me. not sure what is the mistake I am doing it here?&lt;BR /&gt;approach1: I tried calling the RestAPI service using the Restlet from chrome browser with the following data. &lt;A href="https://login.microsoftonline.com/common/oauth2/token" target="_blank"&gt;https://login.microsoftonline.com/common/oauth2/token&lt;/A&gt;&lt;BR /&gt;{&lt;BR /&gt;grant_type: password&lt;BR /&gt;scope: openid&lt;BR /&gt;resource: &lt;A href="https://analysis.windows.net/powerbi/api" target="_blank"&gt;https://analysis.windows.net/powerbi/api&lt;/A&gt;&lt;BR /&gt;client_id: ********************&lt;BR /&gt;username: ********************&lt;BR /&gt;password: ********************&lt;BR /&gt;}&lt;BR /&gt;But I am getting the error as follows:&lt;BR /&gt;{&lt;BR /&gt;"error": "invalid_request",&lt;BR /&gt;"error_description": "AADSTS90014: The request body must contain the following parameter: 'grant_type'.\r\nTrace ID: dea02939-adaf-44ad-9395-00dc9ba89f00\r\nCorrelation ID: d5b77411-5b4f-4858-8afd-1009ad5da0cb\r\nTimestamp: 2018-04-25 15:00:26Z",&lt;BR /&gt;"error_codes":[&lt;BR /&gt;90014&lt;BR /&gt;],&lt;BR /&gt;"timestamp": "2018-04-25 15:00:26Z",&lt;BR /&gt;"trace_id": "dea02939-adaf-44ad-9395-00dc9ba89f00",&lt;BR /&gt;"correlation_id": "d5b77411-5b4f-4858-8afd-1009ad5da0cb"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Approach2: With the same input data and the same RestAPI url, I tried it in Postman, but I am getting different error.&amp;nbsp;&lt;BR /&gt;{&lt;BR /&gt;"error": "invalid_grant",&lt;BR /&gt;"error_description": "AADSTS70002: Error validating credentials. AADSTS50056: Password does not exist in store for this user\r\nTrace ID: 57573138-e630-4813-a722-a198e5997000\r\nCorrelation ID: 46099d23-a758-446c-8b91-ed18d3b8949a\r\nTimestamp: 2018-04-25 14:54:03Z",&lt;BR /&gt;"error_codes": [&lt;BR /&gt;70002,&lt;BR /&gt;50056&lt;BR /&gt;],&lt;BR /&gt;"timestamp": "2018-04-25 14:54:03Z",&lt;BR /&gt;"trace_id": "57573138-e630-4813-a722-a198e5997000",&lt;BR /&gt;"correlation_id": "46099d23-a758-446c-8b91-ed18d3b8949a"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Please let me know what is the mistake here?&lt;/P&gt;&lt;P&gt;&lt;IMG src="C:\Krishnan\Temp\Issues Images snapshot" border="0" alt="" /&gt;&lt;IMG src="C:\Krishnan\Temp\Issues Images snapshot\tokenissue.png" border="0" alt="" /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Apr 2018 15:08:43 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-04-25T15:08:43Z</dc:date>
    <item>
      <title>Issue while generating Embed token with ClientID and login credentials using EmbedApiSample</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Issue-while-generating-Embed-token-with-ClientID-and-login/m-p/403598#M12037</link>
      <description>&lt;P&gt;My requirement is to use the PowerBI embedded to show the .pbix reports in a angular web application.&lt;/P&gt;&lt;P&gt;I'm getting the following error when I try to run this&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/guyinacube/Embed-API-Sample" target="_blank" rel="nofollow noreferrer"&gt;app&lt;/A&gt;&amp;nbsp;(&lt;A href="https://github.com/guyinacube/Embed-API-Sample" target="_blank"&gt;https://github.com/guyinacube/Embed-API-Sample&lt;/A&gt;)&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to create Embed token (as specified in the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://www.youtube.com/watch?v=GPHHdDRSlis&amp;amp;list=PLv2BtOtLblH2Rm9trJPuxmN8Kr8WFv7O0&amp;amp;index=7" target="_blank" rel="nofollow noreferrer"&gt;video&lt;/A&gt;&amp;nbsp;&lt;A href="https://www.youtube.com/watch?v=GPHHdDRSlis&amp;amp;list=PLv2BtOtLblH2Rm9trJPuxmN8Kr8WFv7O0&amp;amp;index=7" target="_blank"&gt;https://www.youtube.com/watch?v=GPHHdDRSlis&amp;amp;list=PLv2BtOtLblH2Rm9trJPuxmN8Kr8WFv7O0&amp;amp;index=7&lt;/A&gt;). The console application is crashing when it is trying to authenticate the credentials.&lt;/P&gt;&lt;PRE&gt;{"AADSTS70002: The request body must contain the following parameter: 'client_secret or client_assertion'.\r\nTrace ID: 4de61335-1397-4912-ba59-62986ddc6200\r\nCorrelation ID: c7a41f92-4279-45c5-8ecf-f67dbb85d225\r\nTimestamp: 2018-04-23 15:20:09Z"}&lt;/PRE&gt;&lt;P&gt;It is breaking with the above exception when it executes the line&lt;/P&gt;&lt;PRE&gt; authenticationResult = await authenticationContext.AcquireTokenAsync(resourceUrl, Secrets.ClientID, credential);&lt;/PRE&gt;&lt;P&gt;I Registered my application with the Power BI App Registration Tool in the link&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://dev.powerbi.com/apps" target="_blank" rel="nofollow noreferrer"&gt;https://dev.powerbi.com/apps&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I provided the following details during registration:&lt;/P&gt;&lt;PRE&gt;App Type:
    Server-side Web app
Redirect URL:
    http://localhost:4200/main/homepage
Home Page URL:
    http://localhost:4200&lt;/PRE&gt;&lt;P&gt;After registering the application with above details, I got both Client ID &amp;amp; Client Secret. In the console I could provide the ClientID, my login credentials, but not able to provide Client Secret. When I execute the application and during the authentication the application is crashing.&lt;/P&gt;&lt;P&gt;Why I am getting this error? How to generate the Embed token?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 21:00:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Issue-while-generating-Embed-token-with-ClientID-and-login/m-p/403598#M12037</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-24T21:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Issue while generating Embed token with ClientID and login credentials using EmbedApiSample</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Issue-while-generating-Embed-token-with-ClientID-and-login/m-p/403612#M12038</link>
      <description>&lt;P&gt;It sounds like the request you're making has the wrong body.&lt;BR /&gt;&lt;BR /&gt;To manually get an access key, see &lt;A href="https://community.powerbi.com/t5/Developer/How-To-Get-embed-token-using-Get-Post-only/td-p/294475" target="_self"&gt;this thread&lt;/A&gt; for details on how to get the token using the REST API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or follow my example using Postman (free tool, use a search engine to find it).&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="PowerBI Access Token.png" style="width: 701px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/92747i3FD70E7D37B9E38C/image-dimensions/701x249?v=v2" width="701" height="249" role="button" title="PowerBI Access Token.png" alt="PowerBI Access Token.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the body, fill in the client_id, username and password field with your values. For grant_type, scope and resource, copy the values in my screenshot or from the link above. Make sure POST is selected and the URL is &lt;SPAN&gt;&lt;A href="https://login.microsoftonline.com/common/oauth2/token" target="_blank"&gt;https://login.microsoftonline.com/common/oauth2/token&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 21:22:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Issue-while-generating-Embed-token-with-ClientID-and-login/m-p/403612#M12038</guid>
      <dc:creator>SuperTommy</dc:creator>
      <dc:date>2018-04-24T21:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: Issue while generating Embed token with ClientID and login credentials using EmbedApiSample</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Issue-while-generating-Embed-token-with-ClientID-and-login/m-p/404327#M12062</link>
      <description>&lt;P&gt;Thanks for your reply. I tried following both the approaches specified by you, but both doesn't seem to work for me. not sure what is the mistake I am doing it here?&lt;BR /&gt;approach1: I tried calling the RestAPI service using the Restlet from chrome browser with the following data. &lt;A href="https://login.microsoftonline.com/common/oauth2/token" target="_blank"&gt;https://login.microsoftonline.com/common/oauth2/token&lt;/A&gt;&lt;BR /&gt;{&lt;BR /&gt;grant_type: password&lt;BR /&gt;scope: openid&lt;BR /&gt;resource: &lt;A href="https://analysis.windows.net/powerbi/api" target="_blank"&gt;https://analysis.windows.net/powerbi/api&lt;/A&gt;&lt;BR /&gt;client_id: ********************&lt;BR /&gt;username: ********************&lt;BR /&gt;password: ********************&lt;BR /&gt;}&lt;BR /&gt;But I am getting the error as follows:&lt;BR /&gt;{&lt;BR /&gt;"error": "invalid_request",&lt;BR /&gt;"error_description": "AADSTS90014: The request body must contain the following parameter: 'grant_type'.\r\nTrace ID: dea02939-adaf-44ad-9395-00dc9ba89f00\r\nCorrelation ID: d5b77411-5b4f-4858-8afd-1009ad5da0cb\r\nTimestamp: 2018-04-25 15:00:26Z",&lt;BR /&gt;"error_codes":[&lt;BR /&gt;90014&lt;BR /&gt;],&lt;BR /&gt;"timestamp": "2018-04-25 15:00:26Z",&lt;BR /&gt;"trace_id": "dea02939-adaf-44ad-9395-00dc9ba89f00",&lt;BR /&gt;"correlation_id": "d5b77411-5b4f-4858-8afd-1009ad5da0cb"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Approach2: With the same input data and the same RestAPI url, I tried it in Postman, but I am getting different error.&amp;nbsp;&lt;BR /&gt;{&lt;BR /&gt;"error": "invalid_grant",&lt;BR /&gt;"error_description": "AADSTS70002: Error validating credentials. AADSTS50056: Password does not exist in store for this user\r\nTrace ID: 57573138-e630-4813-a722-a198e5997000\r\nCorrelation ID: 46099d23-a758-446c-8b91-ed18d3b8949a\r\nTimestamp: 2018-04-25 14:54:03Z",&lt;BR /&gt;"error_codes": [&lt;BR /&gt;70002,&lt;BR /&gt;50056&lt;BR /&gt;],&lt;BR /&gt;"timestamp": "2018-04-25 14:54:03Z",&lt;BR /&gt;"trace_id": "57573138-e630-4813-a722-a198e5997000",&lt;BR /&gt;"correlation_id": "46099d23-a758-446c-8b91-ed18d3b8949a"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Please let me know what is the mistake here?&lt;/P&gt;&lt;P&gt;&lt;IMG src="C:\Krishnan\Temp\Issues Images snapshot" border="0" alt="" /&gt;&lt;IMG src="C:\Krishnan\Temp\Issues Images snapshot\tokenissue.png" border="0" alt="" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 15:08:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Issue-while-generating-Embed-token-with-ClientID-and-login/m-p/404327#M12062</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-25T15:08:43Z</dc:date>
    </item>
  </channel>
</rss>

