<?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 OAuth2.0 Custom Connector TestConnection Issue in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/OAuth2-0-Custom-Connector-TestConnection-Issue/m-p/1037273#M23205</link>
    <description>&lt;P&gt;I've tested a working connector with PowerBI desktop and published this to service but I am facing an issue where the Data Source configuration in the Gateway won't store the OAuth access_token.&lt;BR /&gt;I following the guidance regarding TestConnection found here:&amp;nbsp;&lt;A href="https://github.com/Microsoft/DataConnectors/blob/master/docs/m-extensions.md#implementing-testconnection-for-gateway-support" target="_blank" rel="noopener"&gt;https://github.com/Microsoft/DataConnectors/blob/master/docs/m-extensions.md#implementing-testconnection-for-gateway-support&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue I am facing is that I click Edit Credentials when configuring a Data Source on the gateway - the OAuth flow start and I click to Allow access but it just takes me back to the popup below (with Add being greyed out).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 929px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/258448iDAB6A578CE8A85F6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my VS code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[DataSource.Kind="AdministrateGraphQL", Publish="AdministrateGraphQL.UI"]
shared AdministrateGraph = (query as text) =&amp;gt;
    let
        apiToken = "Bearer " &amp;amp; Extension.CurrentCredential()[access_token],
        Source = Web.Contents("https://api.getadministrate.com/graphql",
        [Headers=[
			    #"Method"="POST",
			    #"Content-Type"="application/json",
                #"Authorization"=apiToken
		    ],
            Content=Text.ToBinary(query)
        ]),
		Output = Json.Document(Source)
    in
        Output;

[DataSource.Kind="AdministrateGraphQL"]
shared TestAdministrateGraph = (query as text) =&amp;gt;
    let
        apiToken = "Bearer " &amp;amp; Extension.CurrentCredential()[access_token],
        Source = Web.Contents("https://api.getadministrate.com/graphql",
        [Headers=[
			    #"Method"="POST",
			    #"Content-Type"="application/json",
                #"Authorization"=apiToken
		    ],
            Content=Text.ToBinary(query)
        ]),
		Output = Json.Document(Source)
    in
        Output;

// Data Source Kind description
AdministrateGraphQL = [
	TestConnection = (dataSourcePath) =&amp;gt; { "AdministrateGraph", dataSourcePath },
    Authentication = [
        OAuth = [
            StartLogin=StartLogin,
            FinishLogin=FinishLogin,
            Refresh=Refresh
        ]
    ],
    Label = Extension.LoadString("Administrate GraphQL Connector") 
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is anyone able to highlight why this isn't working?&lt;/P&gt;</description>
    <pubDate>Mon, 20 Apr 2020 17:24:10 GMT</pubDate>
    <dc:creator>paulalmond91</dc:creator>
    <dc:date>2020-04-20T17:24:10Z</dc:date>
    <item>
      <title>OAuth2.0 Custom Connector TestConnection Issue</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/OAuth2-0-Custom-Connector-TestConnection-Issue/m-p/1037273#M23205</link>
      <description>&lt;P&gt;I've tested a working connector with PowerBI desktop and published this to service but I am facing an issue where the Data Source configuration in the Gateway won't store the OAuth access_token.&lt;BR /&gt;I following the guidance regarding TestConnection found here:&amp;nbsp;&lt;A href="https://github.com/Microsoft/DataConnectors/blob/master/docs/m-extensions.md#implementing-testconnection-for-gateway-support" target="_blank" rel="noopener"&gt;https://github.com/Microsoft/DataConnectors/blob/master/docs/m-extensions.md#implementing-testconnection-for-gateway-support&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue I am facing is that I click Edit Credentials when configuring a Data Source on the gateway - the OAuth flow start and I click to Allow access but it just takes me back to the popup below (with Add being greyed out).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 929px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/258448iDAB6A578CE8A85F6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my VS code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[DataSource.Kind="AdministrateGraphQL", Publish="AdministrateGraphQL.UI"]
shared AdministrateGraph = (query as text) =&amp;gt;
    let
        apiToken = "Bearer " &amp;amp; Extension.CurrentCredential()[access_token],
        Source = Web.Contents("https://api.getadministrate.com/graphql",
        [Headers=[
			    #"Method"="POST",
			    #"Content-Type"="application/json",
                #"Authorization"=apiToken
		    ],
            Content=Text.ToBinary(query)
        ]),
		Output = Json.Document(Source)
    in
        Output;

[DataSource.Kind="AdministrateGraphQL"]
shared TestAdministrateGraph = (query as text) =&amp;gt;
    let
        apiToken = "Bearer " &amp;amp; Extension.CurrentCredential()[access_token],
        Source = Web.Contents("https://api.getadministrate.com/graphql",
        [Headers=[
			    #"Method"="POST",
			    #"Content-Type"="application/json",
                #"Authorization"=apiToken
		    ],
            Content=Text.ToBinary(query)
        ]),
		Output = Json.Document(Source)
    in
        Output;

// Data Source Kind description
AdministrateGraphQL = [
	TestConnection = (dataSourcePath) =&amp;gt; { "AdministrateGraph", dataSourcePath },
    Authentication = [
        OAuth = [
            StartLogin=StartLogin,
            FinishLogin=FinishLogin,
            Refresh=Refresh
        ]
    ],
    Label = Extension.LoadString("Administrate GraphQL Connector") 
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is anyone able to highlight why this isn't working?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 17:24:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/OAuth2-0-Custom-Connector-TestConnection-Issue/m-p/1037273#M23205</guid>
      <dc:creator>paulalmond91</dc:creator>
      <dc:date>2020-04-20T17:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: OAuth2.0 Custom Connector TestConnection Issue</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/OAuth2-0-Custom-Connector-TestConnection-Issue/m-p/1044153#M23298</link>
      <description>&lt;P&gt;Anyone have any thoughts?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 11:28:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/OAuth2-0-Custom-Connector-TestConnection-Issue/m-p/1044153#M23298</guid>
      <dc:creator>paulalmond91</dc:creator>
      <dc:date>2020-04-23T11:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: OAuth2.0 Custom Connector TestConnection Issue</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/OAuth2-0-Custom-Connector-TestConnection-Issue/m-p/1141378#M24018</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am working on developping an Oauth2 connector like you but I'm currently not succeeding, would it be possible to see how you've set up your StarLogin and FinishLogin functions ? I'm struggling with these two functions because I don't need any authorize URL to access my toke, I just need to request the token url with some credentials and I get it, no exampe works like this online&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Otherwise sorry, I can't help you that much ahah&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2020 09:56:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/OAuth2-0-Custom-Connector-TestConnection-Issue/m-p/1141378#M24018</guid>
      <dc:creator>davidvincentret</dc:creator>
      <dc:date>2020-06-04T09:56:20Z</dc:date>
    </item>
  </channel>
</rss>

