<?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 Embed Token API Error: Creating embed token with multiple identities is not supported in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Embed-Token-API-Error-Creating-embed-token-with-multiple/m-p/659123#M18976</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am creating a dashboard in a web application via &lt;STRONG&gt;App Owns Data&lt;/STRONG&gt;. I am able to follow this guide and embed my dashboard to the web application:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embed-sample-for-customers" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/power-bi/developer/embed-sample-for-customers&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, I am trying to implement Row-Level Security via the REST API as mentioned in this guide:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded-row-level-security" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/power-bi/developer/embedded-row-level-security&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the REST API gives me the following error message as the response:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#FF0000"&gt;{'error': {'code': 'InvalidRequest', 'message': 'Creating embed token with multiple identities is not supported'}}&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using almost the same payload (see below) as the one mentioned in the guide, and if I comment-out identities, I get the embed token as normal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{
    "accessLevel": "View",
    "identities": [
        {
            "username": "EffectiveIdentity",
            "roles": [ "Role1", "Role2" ],
            "datasets": [ "fe0a1aeb-f6a4-4b27-a2d3-b5df3bb28bdc" ]
        }
    ]
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas why I'm getting this error message? Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Apr 2019 19:38:26 GMT</pubDate>
    <dc:creator>pbimdland</dc:creator>
    <dc:date>2019-04-01T19:38:26Z</dc:date>
    <item>
      <title>Embed Token API Error: Creating embed token with multiple identities is not supported</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Embed-Token-API-Error-Creating-embed-token-with-multiple/m-p/659123#M18976</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am creating a dashboard in a web application via &lt;STRONG&gt;App Owns Data&lt;/STRONG&gt;. I am able to follow this guide and embed my dashboard to the web application:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embed-sample-for-customers" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/power-bi/developer/embed-sample-for-customers&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, I am trying to implement Row-Level Security via the REST API as mentioned in this guide:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded-row-level-security" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/power-bi/developer/embedded-row-level-security&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the REST API gives me the following error message as the response:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#FF0000"&gt;{'error': {'code': 'InvalidRequest', 'message': 'Creating embed token with multiple identities is not supported'}}&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using almost the same payload (see below) as the one mentioned in the guide, and if I comment-out identities, I get the embed token as normal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{
    "accessLevel": "View",
    "identities": [
        {
            "username": "EffectiveIdentity",
            "roles": [ "Role1", "Role2" ],
            "datasets": [ "fe0a1aeb-f6a4-4b27-a2d3-b5df3bb28bdc" ]
        }
    ]
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas why I'm getting this error message? Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 19:38:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Embed-Token-API-Error-Creating-embed-token-with-multiple/m-p/659123#M18976</guid>
      <dc:creator>pbimdland</dc:creator>
      <dc:date>2019-04-01T19:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Embed Token API Error: Creating embed token with multiple identities is not supported</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Embed-Token-API-Error-Creating-embed-token-with-multiple/m-p/664476#M19035</link>
      <description>&lt;P&gt;Nobody at Microsoft knows what this error means?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2019 14:18:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Embed-Token-API-Error-Creating-embed-token-with-multiple/m-p/664476#M19035</guid>
      <dc:creator>pbimdland</dc:creator>
      <dc:date>2019-04-08T14:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: Embed Token API Error: Creating embed token with multiple identities is not supported</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Embed-Token-API-Error-Creating-embed-token-with-multiple/m-p/778751#M20556</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got the same error and contacted the Microsoft Power BI support team and they helped me out. Turns out there was something wrong with my request.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm creating an App owns data web application in Python Django and this is what works for me.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;import requests
import json

username = '...'
password = '...'
client_id = '...'
report_id = '...'
group_id = '...'
dataset_id = '...'
settings = {
            "accessLevel": "View",
            "identities": [
                {
                "username": "Andrew Ma",
                "roles": [ "Manager" ],
                "datasets": [ dataset_id ]
                }
            ]
        }

data = {
    'grant_type': 'password',
    'scope': 'openid',
    'resource': r'https://analysis.windows.net/powerbi/api',
    'client_id': client_id,
    'username': username,
    'password': password
}
# Get access token
response = requests.post('https://login.microsoftonline.com/common/oauth2/token', data=data)
print(response.content)
access_token = response.json().get('access_token')

# Get embed token
dest = 'https://api.powerbi.com/v1.0/myorg/groups/' + group_id \
    + '/reports/' + report_id + '/GenerateToken'
embed_url = 'https://app.powerbi.com/reportEmbed?reportId=' \
    + report_id + '&amp;amp;groupId=' + group_id
headers = {'Authorization': 'Bearer ' + access_token, 'Content-Type': 'application/json'}
response = requests.post(dest, json=settings, headers=headers)
print(response.content)
embed_token = response.json().get('token')
print(embed_token)&lt;/PRE&gt;&lt;P&gt;Turns out I forgot to add the Content-Type: application/json to the request headers. Also, my settings weren't formatted as json in the request.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps you out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 07:21:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Embed-Token-API-Error-Creating-embed-token-with-multiple/m-p/778751#M20556</guid>
      <dc:creator>jayvandenbos</dc:creator>
      <dc:date>2019-08-29T07:21:41Z</dc:date>
    </item>
  </channel>
</rss>

