<?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 SSO to powerBI REST API from Azure Web App or SharePoint Provider Hosted Add In in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/SSO-to-powerBI-REST-API-from-Azure-Web-App-or-SharePoint/m-p/305699#M8999</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;I am accessing the powerBI dashboards and reports using REST API calls. My application will be Azure Web App or SharePoint provider hosted add in with Azure AD authentication enabled.&lt;/P&gt;&lt;P&gt;&amp;nbsp; I need to authenticate user credentials to poewrBI REST API without additional popup. User will login to webapp/sharepoint addin and further they shouldn't be prompted for login.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At present I am using this code to authenticate user which pops for user name and password.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;protected void signInButton_Click(object sender, EventArgs e)&lt;BR /&gt;{&lt;BR /&gt;//Create a query string&lt;BR /&gt;//Create a sign-in NameValueCollection for query string&lt;BR /&gt;var @params = new NameValueCollection&lt;BR /&gt;{&lt;BR /&gt;//Azure AD will return an authorization code.&lt;BR /&gt;//See the Redirect class to see how "code" is used to AcquireTokenByAuthorizationCode&lt;BR /&gt;{"response_type", "code"},&lt;/P&gt;&lt;P&gt;//Client ID is used by the application to identify themselves to the users that they are requesting permissions from.&lt;BR /&gt;//You get the client id when you register your Azure app.&lt;BR /&gt;{"client_id", Properties.Settings.Default.ClientID},&lt;/P&gt;&lt;P&gt;//Resource uri to the Power BI resource to be authorized&lt;BR /&gt;{"resource", Properties.Settings.Default.PowerBiAPI},&lt;/P&gt;&lt;P&gt;//After user authenticates, Azure AD will redirect back to the web app&lt;BR /&gt;{"redirect_uri", "http://localhost:13526/Redirect"}&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;//Create sign-in query string&lt;BR /&gt;var queryString = HttpUtility.ParseQueryString(string.Empty);&lt;BR /&gt;queryString.Add(@params);&lt;/P&gt;&lt;P&gt;//Redirect authority&lt;BR /&gt;//Authority Uri is an Azure resource that takes a client id to get an Access token&lt;BR /&gt;string authorityUri = Properties.Settings.Default.AADAuthoritySignInUri;&lt;BR /&gt;var authUri = String.Format("{0}?{1}", authorityUri, queryString);&lt;BR /&gt;Response.Redirect(authUri);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Yasotha&lt;/P&gt;</description>
    <pubDate>Fri, 17 Nov 2017 12:13:41 GMT</pubDate>
    <dc:creator>Yaostha</dc:creator>
    <dc:date>2017-11-17T12:13:41Z</dc:date>
    <item>
      <title>SSO to powerBI REST API from Azure Web App or SharePoint Provider Hosted Add In</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/SSO-to-powerBI-REST-API-from-Azure-Web-App-or-SharePoint/m-p/305699#M8999</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;I am accessing the powerBI dashboards and reports using REST API calls. My application will be Azure Web App or SharePoint provider hosted add in with Azure AD authentication enabled.&lt;/P&gt;&lt;P&gt;&amp;nbsp; I need to authenticate user credentials to poewrBI REST API without additional popup. User will login to webapp/sharepoint addin and further they shouldn't be prompted for login.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At present I am using this code to authenticate user which pops for user name and password.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;protected void signInButton_Click(object sender, EventArgs e)&lt;BR /&gt;{&lt;BR /&gt;//Create a query string&lt;BR /&gt;//Create a sign-in NameValueCollection for query string&lt;BR /&gt;var @params = new NameValueCollection&lt;BR /&gt;{&lt;BR /&gt;//Azure AD will return an authorization code.&lt;BR /&gt;//See the Redirect class to see how "code" is used to AcquireTokenByAuthorizationCode&lt;BR /&gt;{"response_type", "code"},&lt;/P&gt;&lt;P&gt;//Client ID is used by the application to identify themselves to the users that they are requesting permissions from.&lt;BR /&gt;//You get the client id when you register your Azure app.&lt;BR /&gt;{"client_id", Properties.Settings.Default.ClientID},&lt;/P&gt;&lt;P&gt;//Resource uri to the Power BI resource to be authorized&lt;BR /&gt;{"resource", Properties.Settings.Default.PowerBiAPI},&lt;/P&gt;&lt;P&gt;//After user authenticates, Azure AD will redirect back to the web app&lt;BR /&gt;{"redirect_uri", "http://localhost:13526/Redirect"}&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;//Create sign-in query string&lt;BR /&gt;var queryString = HttpUtility.ParseQueryString(string.Empty);&lt;BR /&gt;queryString.Add(@params);&lt;/P&gt;&lt;P&gt;//Redirect authority&lt;BR /&gt;//Authority Uri is an Azure resource that takes a client id to get an Access token&lt;BR /&gt;string authorityUri = Properties.Settings.Default.AADAuthoritySignInUri;&lt;BR /&gt;var authUri = String.Format("{0}?{1}", authorityUri, queryString);&lt;BR /&gt;Response.Redirect(authUri);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Yasotha&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2017 12:13:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/SSO-to-powerBI-REST-API-from-Azure-Web-App-or-SharePoint/m-p/305699#M8999</guid>
      <dc:creator>Yaostha</dc:creator>
      <dc:date>2017-11-17T12:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: SSO to powerBI REST API from Azure Web App or SharePoint Provider Hosted Add In</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/SSO-to-powerBI-REST-API-from-Azure-Web-App-or-SharePoint/m-p/306604#M9018</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/43746"&gt;@Yaostha&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I don't know too much about SSO, however per my understanding, it is more some configuration in Sharepoint side, see&amp;nbsp;&lt;A href="https://blogs.msdn.microsoft.com/sambetts/2014/09/09/setup-sharepoint-online-on-premises-single-sign-on-sso/" target="_self"&gt;Setup SharePoint Online &amp;amp; On-Premises Single-Sign-on (SSO)&lt;/A&gt;. You can't just avoid such "multiple logins" in C# code.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2017 07:17:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/SSO-to-powerBI-REST-API-from-Azure-Web-App-or-SharePoint/m-p/306604#M9018</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2017-11-20T07:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: SSO to powerBI REST API from Azure Web App or SharePoint Provider Hosted Add In</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/SSO-to-powerBI-REST-API-from-Azure-Web-App-or-SharePoint/m-p/306628#M9019</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Thanks. But I am looking for SSO to Power BI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Yasotha&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2017 07:40:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/SSO-to-powerBI-REST-API-from-Azure-Web-App-or-SharePoint/m-p/306628#M9019</guid>
      <dc:creator>Yaostha</dc:creator>
      <dc:date>2017-11-20T07:40:44Z</dc:date>
    </item>
  </channel>
</rss>

