<?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 Power BI API authorization issue through Office 365 group in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-API-authorization-issue-through-Office-365-group/m-p/3376631#M43848</link>
    <description>&lt;P&gt;We have a .NET Core application that embeds reports to web pages using the "User Owns Data" model. We assigned an Office 365 group as "Viewer" of the Workspace, but users of that group are getting 401 Unauthorized error when calling the GetReportInGroupAsync method. I assume users should get the "Viewer" permission through the group. How can we solve this problem? Thank you!&lt;/P&gt;</description>
    <pubDate>Fri, 11 Aug 2023 15:44:25 GMT</pubDate>
    <dc:creator>bwang1</dc:creator>
    <dc:date>2023-08-11T15:44:25Z</dc:date>
    <item>
      <title>Power BI API authorization issue through Office 365 group</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-API-authorization-issue-through-Office-365-group/m-p/3376631#M43848</link>
      <description>&lt;P&gt;We have a .NET Core application that embeds reports to web pages using the "User Owns Data" model. We assigned an Office 365 group as "Viewer" of the Workspace, but users of that group are getting 401 Unauthorized error when calling the GetReportInGroupAsync method. I assume users should get the "Viewer" permission through the group. How can we solve this problem? Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2023 15:44:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-API-authorization-issue-through-Office-365-group/m-p/3376631#M43848</guid>
      <dc:creator>bwang1</dc:creator>
      <dc:date>2023-08-11T15:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI API authorization issue through Office 365 group</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-API-authorization-issue-through-Office-365-group/m-p/3382365#M43917</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="601986" data-lia-user-login="bwang1" class="lia-mention lia-mention-user"&gt;bwang1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;According to the error message, it seems that&amp;nbsp;&lt;SPAN&gt;the "group" making the API call may not have sufficient privileges to access the reports. Make sure that &amp;nbsp;the "group" has been granted the appropriate permissions in Azure AD and Power BI. I found the following thread which has the similar problem as yours, hope it can help you solve the problem.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://stackoverflow.com/questions/63837108/unauthorized-response-on-getreportingroupasync-powerbi-embedded-api-call-using-s" target="_blank"&gt;c# - Unauthorized response on GetReportInGroupAsync PowerBI Embedded API call using Service Principal - Stack Overflow&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;For Service Principal to work for any embedding, you need to enable Service Principal option in Power BI Admin portal and then, add it to the Power BI workspace.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Please check the following once:&lt;/FONT&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;FONT size="3"&gt;Check if service principal is enabled under Admin portal in Power BI service. Follow&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-service-principal#step-3---enable-the-power-bi-service-admin-settings" rel="noreferrer" target="_blank"&gt;step 3&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;onwards&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT size="3"&gt;If things don't work for you after following the above step, try embedding with the developer&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/microsoft/PowerBI-Developer-Samples/tree/master/.NET%20Core/Embed%20for%20your%20customers" rel="noreferrer" target="_blank"&gt;sample&lt;/A&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Besides, based on your code it looks like you are using ADAL library for authentication. Microsoft&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://learn.microsoft.com/en-us/azure/active-directory/develop/msal-migration#:%7E:text=We%20now%20recommend%20using%20the,Azure%20AD%20identities" rel="noreferrer" target="_blank"&gt;recommends to use MSAL library&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;for authentication with Azure AD entities.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;Also, you can use certificate instead of app secret for service principal authentication. (&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-service-principal-certificate" rel="noreferrer" target="_blank"&gt;Docs&lt;/A&gt;)&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2023 08:55:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-API-authorization-issue-through-Office-365-group/m-p/3382365#M43917</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-16T08:55:23Z</dc:date>
    </item>
  </channel>
</rss>

