<?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: Microsoft.Data.Mashup.CredentialError.Reason CredentialInvalid in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Microsoft-Data-Mashup-CredentialError-Reason-CredentialInvalid/m-p/548748#M17100</link>
    <description>&lt;P&gt;One more clue:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I changed the custom data connector code&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;XXX = [
     TestConnection = (dataSourcePath) =&amp;gt; { "XXX.Contents" },
    Authentication = [
        OAuth = [
            StartLogin = StartLogin,
            FinishLogin = FinishLogin,
            Logout = Logout,
            Label = Extension.LoadString("AuthenticationLabel")
        ]
    ],
    Label = Extension.LoadString("DataSourceLabel"),
    &lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt;SupportsEncryption = false&lt;/STRONG&gt;&lt;/FONT&gt;
];&lt;/PRE&gt;&lt;P&gt;To NOT Support encryption and the refresh works fine. So the question is what should a custom data connector developer&amp;nbsp;do in order for his/her code to work with&amp;nbsp;encrypted connections?&lt;/P&gt;&lt;P&gt;I though that the encryption / decryption will be handled by the service / gateway and that the custom data connector should not be ware of the calling context.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Oct 2018 14:59:59 GMT</pubDate>
    <dc:creator>smeneg</dc:creator>
    <dc:date>2018-10-22T14:59:59Z</dc:date>
    <item>
      <title>Microsoft.Data.Mashup.CredentialError.Reason CredentialInvalid</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Microsoft-Data-Mashup-CredentialError-Reason-CredentialInvalid/m-p/548622#M17099</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are developin a custom data connector to connec to through a custom WEB API to a SaaS application.&lt;/P&gt;&lt;P&gt;The Authentication type is similar to the github example i.e. OAuth2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;XXX = [
     TestConnection = (dataSourcePath) =&amp;gt; { "XXX.Contents" },
    Authentication = [
        OAuth = [
            StartLogin = StartLogin,
            FinishLogin = FinishLogin,
            Logout = Logout,
            Label = Extension.LoadString("AuthenticationLabel")
        ]
    ],
    Label = Extension.LoadString("DataSourceLabel"),
    SupportsEncryption = true
];&lt;/PRE&gt;&lt;P&gt;From Power BI Desktop everyting works fine.&lt;/P&gt;&lt;P&gt;These days we are moving to the Pro features where we publish the dataset and or reports that have been developed using data from our XXX connector (ONLY&amp;nbsp;from this source).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have downloaded and succesfully installed the latest version of the On Premises Gateway (not the personal one).&lt;/P&gt;&lt;P&gt;We&amp;nbsp;have succesfsfully setup the connection, the datasource as shown in the figure below&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="pbi01.jpg" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/127544i7E91522912E04179/image-size/large?v=v2&amp;amp;px=999" role="button" title="pbi01.jpg" alt="pbi01.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the datasource part of the service we have the status as shown in the following screenshot:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pb02.jpg" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/127546i19FEF4FCD2DDEE09/image-size/large?v=v2&amp;amp;px=999" role="button" title="pb02.jpg" alt="pb02.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the error we got from both refresh and scheduled refresh is the following:&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="pb03.jpg" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/127548i3EF265EEAC260B46/image-size/large?v=v2&amp;amp;px=999" role="button" title="pb03.jpg" alt="pb03.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the custom connector code level all the calls to the api are using the &lt;EM&gt;&lt;STRONG&gt;access_token&lt;/STRONG&gt;&lt;/EM&gt; like in the example below:&lt;/P&gt;&lt;PRE&gt;WebAPI_GetTopLevelMenu = ()  =&amp;gt;
    let 
        ebsCommand = "asset",
        params = Uri.BuildQueryString([routeId = "PBZ.json"]),
&lt;STRONG&gt;        skey = Extension.CurrentCredential()[access_token],&lt;/STRONG&gt;
        url = Uri.Combine(apiURL, apiCommand) &amp;amp; "?" &amp;amp; params,
        wb = Web.Contents(url, [Headers = [#"Authorization" = "Bearer " &amp;amp; skey]]),
        tb = Text.FromBinary(wb),
        js = Json.Document(tb)
    in
        js;&lt;/PRE&gt;&lt;P&gt;Like I said, when running fvrom Power BI Desktop everything works fine (OAUTH sign in, execution of api cals leading to fetching data, etc.&lt;/P&gt;&lt;P&gt;Can&amp;nbsp;someone please give me a direction on how to "debug" the error ?&lt;/P&gt;&lt;P&gt;Is it due to the gateway? due to the connector?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stavros&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 13:00:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Microsoft-Data-Mashup-CredentialError-Reason-CredentialInvalid/m-p/548622#M17099</guid>
      <dc:creator>smeneg</dc:creator>
      <dc:date>2018-10-22T13:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: Microsoft.Data.Mashup.CredentialError.Reason CredentialInvalid</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Microsoft-Data-Mashup-CredentialError-Reason-CredentialInvalid/m-p/548748#M17100</link>
      <description>&lt;P&gt;One more clue:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I changed the custom data connector code&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;XXX = [
     TestConnection = (dataSourcePath) =&amp;gt; { "XXX.Contents" },
    Authentication = [
        OAuth = [
            StartLogin = StartLogin,
            FinishLogin = FinishLogin,
            Logout = Logout,
            Label = Extension.LoadString("AuthenticationLabel")
        ]
    ],
    Label = Extension.LoadString("DataSourceLabel"),
    &lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt;SupportsEncryption = false&lt;/STRONG&gt;&lt;/FONT&gt;
];&lt;/PRE&gt;&lt;P&gt;To NOT Support encryption and the refresh works fine. So the question is what should a custom data connector developer&amp;nbsp;do in order for his/her code to work with&amp;nbsp;encrypted connections?&lt;/P&gt;&lt;P&gt;I though that the encryption / decryption will be handled by the service / gateway and that the custom data connector should not be ware of the calling context.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 14:59:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Microsoft-Data-Mashup-CredentialError-Reason-CredentialInvalid/m-p/548748#M17100</guid>
      <dc:creator>smeneg</dc:creator>
      <dc:date>2018-10-22T14:59:59Z</dc:date>
    </item>
  </channel>
</rss>

